Re: Turn on compiler warnings by default for AC_PROG_CC, AC_PROG_CXX & AC_PROG_FC

Russ Allbery <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches
Organization The Eyrie
Message-ID <[email protected]>
Zack Weinberg <[email protected]> writes:

> -ansi, however, should not be in there at all; it doesn't just turn on
> strict conformance mode, it turns on strict *C89* conformance mode,
> which is often wrong for new code.  And even nowadays, strict
> conformance mode in general tends to break system headers.

Seconded.  I have one package that I do test with -ansi, but mostly out of
personal curiosity.  Satisfying -ansi requires several contortions that
are not really helpful for real-world portability for typical free
software packages, such as limiting the length of quoted strings and
messing about with feature-test macros.  I think it's more of a
specialized flag best reserved for environments with very particular
standards-conformance requirements, or where one is targeting platforms
that may not provide any functionality over the bare ANSI minimum.

The same concerns apply to a lesser extent to --std=c99 or --std=c11.

-- 
Russ Allbery ([email protected])              <http://www.eyrie.org/~eagle/>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.