於 一,2015-06-29 於 10:00 +0200,Thomas Jahns 提到: > Hi Alex, > > On 06/28/15 16:21, Alex Vong wrote: > > Besides, the code base is quite old and as we know compilers always > > add new warnings. I have asked upstream about fixing the warnings, but > > it seems there is no easy way to fix all of them. So I want to know is > > there a portable way to silent all compiler warnings? Since there are > > lots of warnings even without '-Wall -Wextra'. I want to know how do > > you think about it. > > since you are using gcc, there are -fsyntax-only and -w which should provide > less verbose builds. But there are only very few portable compiler options > (like > -I, -D) and to my knowledge none address warnings. > > You could of course redirect all compiler stderr output to /dev/null and thus > get rid of it, i.e. add 2>/dev/null to your make calls. But this will make > debugging build failures harder later on. > > Regards, Thomas > > Hi Thomas,
Thanks for telling me there is no portable flag for doing so. I am now using AC_SUBST() to set the value of STREAM and append ` $(STREAM)>/dev/null' to every make command. If the user configure with --enable-verbose-compiler, then STREAM will be set to 0, otherwise STREAM will be set to 2. This keeps the flexibility. Does it sound reasonable? Cheers, Alex