This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -std=c90 -pedantic-errors and <stdint.h>
On 2017-05-31 01:11 +0200, Vincent Lefevre wrote:
> On 2017-05-31 00:19:27 +0800, Xi Ruoyao wrote:
> > On 2017-05-30 17:10 +0200, Vincent Lefevre wrote:
> > > Is it normal that -std=c90 -pedantic-errors allows to use
> > >
> > > #include <stdint.h>
> > >
> > > ?
> > >
> > > This is annoying when one wants to check for code portability
> > > (and bugs).
> >
> > I don't think this is a GCC issue. GCC just find stdint.h, and
> > include it into the source file.
>
> However, GCC knows about standard headers, so that it could
> blacklist <stdint.h> as a special case.
>
I don't think so... We can't blacklist a header just because it is
named stdint.h. That's a worse behaviour which is not portable.
There are many headers "not portable" in the environment.
For example, linux/random.h, bits/stdc++.h and emmintrin.h.
Should we blacklist them all with -std=c90 -pedantic-errors?
See the discussion in]
<https://stackoverflow.com/questions/26502307/gcc-options-for-strict-c90-code>.
I think we should check the usage of headers ourselves.
--
Xi Ruoyao <ryxi@stu.xidian.edu.cn>
School of Aerospace Science and Technology, Xidian University