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

Hib Eris hib at hiberis.nl
Sat Mar 12 10:08:00 PST 2011


Hi,

On Sat, Mar 12, 2011 at 5:46 PM, Pino Toscano <pino at kde.org> wrote:
> Hi,
>
> currently we have (in both the build systems, of course) the option to
> enable the compiler warnings, with the following values:
> - no: no CXXFLAGS added
> - yes (the default): some CXXFLAGS warnings added
> - kde: more CXXFLAGS added
>
> I've done the following patch to simplify the situation a bit, making
> the warning option (--enable-compile-warnings for autotools,
> ENABLE_COMPILE_WARNINGS for cmake) a simple yes/no option:
> - no (the default): the current "yes" CXXFLAGS
> - yes: all the "no" CXXFLAGS plus the other current "kde" ones
>
> The rationale is the following:
> - compiling without warnings is just a no-no, could hide really huge
> mistakes
> - we should put as much useful warnings as possible being used
> unconditionally (eg take an useful cxxflag, make sure poppler is clean
> with it, add it to the base ones)
> - it does not make any sense to enable "kde" warnings: those are
> useful... because of themselves, not because they are "used by kde"
>
> Thoughts? May I commit it?
>
> --
> Pino Toscano
>
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
>
>


Great work cleaning this up. One remark:

case "$enable_compile_warnings" in
+    yes)
+      extra_cxxflags="$extra_cxxflags \
+                      -D_XOPEN_SOURCE=600 -D_BSD_SOURCE \

The definition of  these macro's are not about warnings, but can cause
all kinds of unix/posix definitions to be exposed in header files,
thus changing the compiled code. I do not think they should be part of
the warning flags (and from a Windows viewpoint, I am a bit worried
that it would cause wrong compile results).

Hib Eris


More information about the poppler mailing list