From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id 5E77D385AC12 for ; Mon, 22 Aug 2022 03:03:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5E77D385AC12 Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 6F7236630F; Sun, 21 Aug 2022 23:03:17 -0400 (EDT) Message-ID: <2351f99b1bc5bb8f120e132354b2580b5163916a.camel@xry111.site> Subject: Re: -fno-builtin not preventing __builtin___snprintf_chk in gcc 11.2.0-19ubuntu1 From: Xi Ruoyao To: Reid Wahl , gcc-help@gcc.gnu.org Date: Mon, 22 Aug 2022 11:03:10 +0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, KAM_NUMSUBJECT, LIKELY_SPAM_FROM, PDS_OTHER_BAD_TLD, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Aug 2022 03:03:22 -0000 On Sun, 2022-08-21 at 19:39 -0700, Reid Wahl via Gcc-help wrote: For the title: -fno-builtin only prevents gcc to convert foo() to __builtin_foo(). If you write __builtin_foo() directly built-in will be used with or without -fno-builtin. The remaining discussion is not related to GCC anyway. _FORTIFY_SOURCE is a Glibc (not GCC) feature, and it's just enabled by default because the distro is *too* smart... I completely agree to add - D_FORTIFY_SOURCE when they build their .deb packages, but hard wiring this into GCC is just puzzling new users and causing them to wrongly believe this was a "feature" of vanilla GCC. To make things worse, many people use Ubuntu as their first Linux distro... --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University