On Fri, Aug 10, 2012 at 11:44 AM, Martin Landa <[email protected]> wrote: > Hi, > > 2012/8/10 Markus Neteler <[email protected]>: >>> If this is a real problem, why fix the symptoms and not the cause? >>> That would probably be the macro defining _(). >> >> +1 >> It worked for the past 10-xx years, so I don't see a reason why >> messing up the code when one specific gcc version complains. > > agreed, in any case such changes should be discussed in ML before > applying them in SVN. > > grep "G_fatal_error(\"%s\", _(" * -R --include=*.c -l > general/g.proj/input.c > raster/r.lake/main.c
My compile flags are -Wall -Wextra -fno-common -fexceptions -Werror=implicit-function-declaration These are not enough to trigger the warnings, the gcc 4.6.3 I use needs at least one of -Wall -Wformat -Wno-format-extra-args -Wformat-security -Wformat-nonliteral -Wformat=2 With regard to r.lake, the warnings seem to be bogus because the contents of the message strings are out of user control. If these warnings should be fixed, I guess the right place is either fixing the _ macro or G_message(), G_warning(), G_fatal_error(). Any user input always goes first through the parser, thus the parser could be modified and afterwards the extra format-related -W flags are no longer needed. In any case it seems to me that fixing that for every instance of G_message(), G_warning(), G_fatal_error() and any print functions is not really feasible. Markus M _______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
