Re: Pedantic mode and standard headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
Xi Ruoyao <xry111@xxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux