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 55BBF3858C74 for ; Wed, 30 Aug 2023 08:44:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 55BBF3858C74 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1693385039; bh=zHhp/r3pgYX1MLsWUgdfCkJY092L1N511bXaoG1tlO4=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=cHPQoQ3drxSgRu1teFoViJm4jv2+HqplXM8kp8kwBedD04v+2fbpXmQk+xKwFcDk2 E2FbxavwcBXl0nZNrKAZz4H8xPizIzclgTCeI3Fw35tN60EcFSxIwE/frjWY6tgX+5 g+n0yukBl2MtfQi+L/8c66orMvkRvyXS+zFIw9Vs= 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 2DEE7659C0; Wed, 30 Aug 2023 04:43:59 -0400 (EDT) Message-ID: Subject: Re: Pedantic mode and standard headers From: Xi Ruoyao To: Andy Cc: gcc-help@gcc.gnu.org Date: Wed, 30 Aug 2023 16:43:57 +0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,LIKELY_SPAM_FROM,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 2023-08-30 at 02:21 +0200, Andy via Gcc-help wrote: > C90 mode allows GNU extensions, I I care about clean C90 because I try > to write C90 ANTLR grammar. Pedantic mode helps. > Standard header uses GNU extensions (?) and if I preprocess file, it > wii: > - pedantic mode change preprocessed file and no GNU extension in this > file No. > - in the preprocessed file will GNU extensions. Yes. > I have questions: if in a preprocessed file will GNU extensions. it > compile with Pedantic mode? It depends on what a "preprocessed file" is. Normally the preprocessed file outputted by GCC contains linemarkers like # 1 "/usr/include/stdio.h" 1 3 4 here "3" means the following text comes from a system header file, so pedantic warnings are disabled. But if the preprocessed file is generated with "gcc -E -P", then linermarkers are removed by "-P" so the pedantic warnings will alarm. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University