|
From: | Julien ÉLIE |
Subject: | Re: Testing for unknown flags in different compilers |
Date: | Fri, 21 Feb 2014 19:40:47 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Hi Bob,
I have been working on a changes whereby an autoconf user can invoke a macro like AC_WARN_ADD([-Wextra]) to add user-specified flags to the compiler/linker invocations.I don't think that it is a particularly good idea to enable any warning options by default in a package unless the warnings are likely to indicate that the code the developer should have already perfected is somehow faulty (e.g. unexpected interface definition or missing prototype) on the system it is being built on. Usually only the developers of a package are interested in seeing and fixing warnings. Warnings are only a cause for concern (usually undue concern) for others.
I believe the suggested macro could be worthwhile (from the standpoint of a developer) in the case of building a software on various OSes on different platforms (for instance the GCC C Farm servers). One could then have a WARNINGS variable in his Makefile with the recognized flags on the platform (thanks to checks done by several calls to the suggested AC_WARN_ADD macro, that incidentally should have a second variable to tell which variable to populate -- for instance here, the WARNINGS variable).
Then, for automatic builds on several OSes, I would only have to run "make warnings" that I would have told to run the compiler with $WARNINGS appended. This way, no need to worry about the set of flags available on the platform. It would be found out automatically. Of course, apart from automatic builds, it could be useful for manual builds (by developers running "make warnings").
Though I agree that it is not a good idea to add these flags by default to the end user, the feature could be useful for other people.
-- Julien ÉLIE « Tous les champignons sont comestibles. Certains, une fois seulement. »
[Prev in Thread] | Current Thread | [Next in Thread] |