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

Re: libc6-dev and "-pedantic -O" warnings



Chris Waters <xtifr@dsp.net>:
> Using the switches you list may well turn off some library features
> that make the code more efficient when compiled with gcc.  I'd rather
> treat those as internal compiler details, and not force the libraries
> to *pretend* that they're written as strictly conforming code, as long
> as the *result* is that they *act* in a strictly conforming way, which
> they do, even when they generate the warnings.

Yes, the library and its headers may be written in any way the
developers want, as long as they obey the relevant standards.

However, the issue here, as far as I understand it, is that if one
does use gcc -pedantic (or other similar options) to check one's own
code for problems, then one should NOT get any warnings or errors from
the library part. This is not a standards compatibility issue, but a
"quality of implementation" and plain old usability issue.

When I check for problems with gcc -pedantic (and other options), I do
not care about efficiency, and the library is free to implement things in
the slowest manner they wish, as long as things work. Getting spurious
warnings from the library headers makes it more difficult for me to
get my work done (since I have to check that the warnings from the
library headers are not caused by my own code).

I once used a C implementation where every inclusion of stdio.h caused
several lines of warnings to be printed (even without any extra options
to cc). That wasn't particularly funny.

-- 
Stupid little mailer under construction, sorry for any problems.

Attachment: pgpjpcvmhM6f_.pgp
Description: PGP signature


Reply to: