From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe2c.google.com (mail-vs1-xe2c.google.com [IPv6:2607:f8b0:4864:20::e2c]) by sourceware.org (Postfix) with ESMTPS id 60093386100B for ; Mon, 24 Aug 2020 07:14:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 60093386100B Received: by mail-vs1-xe2c.google.com with SMTP id a13so3908554vso.12 for ; Mon, 24 Aug 2020 00:14:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=oAxXxgqOFgLWme+wbAefu9u3NeZDWrZqjNB4cT8oNdI=; b=jOO25GRhjosL4bws1iPMp2mbueuqAQkBDCMbi+1bnhSCrgWpTI8PjOJ2OleE3y5zUU BGyE+vPby66LPga6tbzZroWmoyNG25iGLZVbOgxGfmuwieUtdW/k64i3LggBJL9M1GWF eCTyb0+EcJgl0RNzz4Pomr5idhRnq0wUVqfTOnyA2MOLx32L7HI5WaLacsPqUVAzs2Zc BTUJSP81/EWMtcaQwUlTg57Tl/8Tk+asB23Hnm7fT1B7f6FJJW7Z/p9cPTSkZJ9/qOi0 bTRnAJBdz6d674pDBpG4/bsZgn7qufXYJb/URKY+KtC/WLMMDQD4q8qYLB44i9KuzfOQ K40A== X-Gm-Message-State: AOAM530/UV2vv4C4mQQfZcg+QZ4qOKylqlGNTfIgznQ+1vzr88MnVHsD ITvJKVyyIBcmoQHuRG1Dur144SQs+7Abfx44ham7f3is8+Y= X-Google-Smtp-Source: ABdhPJy7A5sT3E1s0c6dYyJBJ4VhOlx8MQWkRDYfl/rOxuy08BFfHkIPq2N2Zu5kWPgRlSAFQF0XIyqRYBCl4mLpRBU= X-Received: by 2002:a67:8ec7:: with SMTP id q190mr1629701vsd.75.1598253291433; Mon, 24 Aug 2020 00:14:51 -0700 (PDT) MIME-Version: 1.0 From: Yingchun Li Date: Mon, 24 Aug 2020 15:14:40 +0800 Message-ID: Subject: Why the cplusplus doesn't support -D_FORTIFY_SOURCE To: newlib@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Aug 2020 07:14:53 -0000 Sorry, My previous post https://sourceware.org/pipermail/newlib/2020/017909.html shows the wrong format, sorry for that. Now post it again. In the sys/features.h, the "__SSP_FORTIFY_LEVEL" will not be defined when the source file is cplusplus. #if _FORTIFY_SOURCE > 0 && !defined(__cplusplus) && !defined(__lint__) && \ (__OPTIMIZE__ > 0 || defined(__clang__)) && __GNUC_PREREQ__(4, 1) # if _FORTIFY_SOURCE > 1 # define __SSP_FORTIFY_LEVEL 2# else# define __SSP_FORTIFY_LEVEL 1 # endif #else # define __SSP_FORTIFY_LEVEL 0 #endif So, if defined cplusplus, the __SPP_FORTIFY_LEVEL is always 0.My question is why disable this feature, if enable this feature forcely, is there any possible issue? Br,Yingchun