Re: -std=c90 -pedantic-errors and <stdint.h>

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

 



On 2017-05-31 09:00:21 +0800, Xi Ruoyao wrote:
> On 2017-05-31 01:11 +0200, Vincent Lefevre wrote:
> > 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?

More than "not portable", they are non-standard. So, they could just
be regarded as user code (with a dependency on them). So, there are
no reasons to blacklist them. <stdint.h> is different because it is
standard in C99+, even in free-standing implementations. Thus it
cannot be user code (possible except for old, no longer maintained
software supporting C90 *only*, but in that case, -pedantic-errors
wouldn't be used).

> 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.

Perhaps. In most cases, this would be sufficient to detect portability
issues.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



[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