[GRASS-dev] [GRASS-SVN] r52607 - grass/trunk/raster/r.lake

Markus Metz markus.metz.giswork at gmail.com
Fri Aug 10 03:20:26 PDT 2012


On Fri, Aug 10, 2012 at 11:44 AM, Martin Landa <landa.martin at gmail.com> wrote:
> Hi,
>
> 2012/8/10 Markus Neteler <neteler at osgeo.org>:
>>> 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


More information about the grass-dev mailing list