On Wed, Sep 19, 2012 at 5:01 PM, Eric Blake <eblake@xxxxxxxxxx> wrote: > I just helped someone debug an issue today where their configure run was > getting weird results, because they had called './configure > CFLAGS="-Wall -Werror -O0 -g"', and the -Werror was causing several > tests to guess wrong. > > This issue has repeatedly come up on this list, and our advice has > always been "don't use -Werror during configure; save it for 'make'". > In fact, we even have examples to point to on how to write a configure > script that will probe whether -Werror works and add it automatically at > make time without also polluting the rest of the configure run (such as > via coreutils' ./configure --enable-gcc-warnings, coupled with > Makefile.am snippets to add -Werror to AM_CFLAGS as appropriate). > > For packages that already take care to separate out -Werror handling, > I'm thinking it might be worthwhile to have a macro that would emit a > warning at ./configure time if CC is detected as gcc, and CFLAGS > contains -Werror, since this usually won't have the desired results. Of > course, it would need to be a new macro (we don't want to change the > behavior of configure to add a warning without explicit request by > package maintainers), but it seems like something that enough packages > would like to be worth including in the next autoconf release. It seems > like such a macro should be called after AC_PROG_CC (need to know if the > compiler is gcc). > > Thoughts? Does my idea make sense? What would a good macro name be? > AC_PROG_CC_SUSPICIOUS_CFLAGS > AC_PROG_CC_NO_WERROR The best solution for users is likely to be similar to "do the sane thing so things work." If that means hding -Werror so things work as intended, that that is probably one of the better paths to take. As a dumb user, I want to use a cookbook. That means I want to do a: ./configure CFLAGS="-Wall -Wextra ...." I don't want to have to learn how to use autoconf, automake, and make. I don't want to subscribe to mailing list to make things work. I just want it to work as expected. The dumb user (me) is likely not the same person who decided to use the tool chain (the maintainers). Maintainers are probably much more savvy users. No disrespect intended. Jeff _______________________________________________ Autoconf mailing list Autoconf@xxxxxxx https://lists.gnu.org/mailman/listinfo/autoconf