[poppler] [PATCH] Simplify the GCC compiler flags/warnings

Albert Astals Cid aacid at kde.org
Sun Mar 13 05:34:20 PDT 2011


A Dissabte, 12 de març de 2011, Pino Toscano va escriure:
> Alle sabato 12 marzo 2011, Hib Eris ha scritto:
> > Two more remarks:
> > 
> > +if test "x$GCC" == xyes; then
> > +  extra_cxxflags="-Wall -Wno-write-strings -Woverloaded-virtual \
> > +                  -Wnon-virtual-dtor -Wcast-align -fno-exceptions \
> > +                  -fno-check-new -fno-common"
> > +  case "$enable_compile_warnings" in
> > +    yes)
> > +      extra_cxxflags="$extra_cxxflags \
> > +                      -D_XOPEN_SOURCE=600 -D_BSD_SOURCE \
> > +                      -W -Wno-long-long -Wundef -Wconversion
> > -Wpointer-arith \ +                      -Wwrite-strings
> > -Wformat-security \
> > +                      -Wmissing-format-attribute"
> > +      ;;
> > +    esac
> > +  CXXFLAGS="$extra_cxxflags $CXXFLAGS"
> > +fi
> > 
> > 
> > 1. In the 'yes' case, you end up with both  -Wno-write-strings and
> > -Wwrite-strings, it is at least not obvious which one the compiler
> > will pick.
> 
> The last of course.

I disagree with that. It will result in people sending patches to move all 
char * to const char* which adds nothing but noise to the git history.

I'd just scrap the "extra warnings" setting and by default enable the ones we 
think make sense and that's it.

Albert

> 
> > 2. The '-W' option could (and in my opinion should) be replaced by
> > '-Wextra', see  [1].
> 
> That's minor, and that's beside the point of the changes I am proposing
> (ie change the way warnings are set in poppler, without changing which
> ones are added).


More information about the poppler mailing list