[GRASS-dev] compilation of grass on AIX 7.1

Vaclav Petras wenzeslaus at gmail.com
Sat Jul 20 03:06:22 PDT 2013


On 18 July 2013 20:48, Glynn Clements <glynn at gclements.plus.com> wrote:
>> gmake[3]: Entering directory
>> `/gpfs/home/neteler/software/grass-7.0.svn/lib/imagery'
>> ...
>> iclass_statistics.c: In function 'I_iclass_free_statistics':
>> iclass_statistics.c:114:5: warning: passing argument 1 of 'G_free'
>> discards 'const' qualifier from pointer target type [enabled by
>> default]
>
> The IClass_statistics structure declares name and color as
> "const char *".
>
> Either the fields should be changed to "char *", or
> I_iclass_free_statistics() should explicitly cast them in the G_free()
> calls.

Because the `const char *` is generally the right type for string in
C, I added the casts to the I_iclass_free_statistics() function. Done
in r57232.

The signature of G_free is `void G_free(void *)`, so it will trigger
warnings with the more strict compiler settings anyway (this can
happen e.g. for C++ code). However, I guess that we will not add these
casts to grass code.

GCC warns me also about "format not a string literal and no format
arguments". I remember this was once discussed on the ML but I'm not
sure what the result was: the call is correct but the G_warning
function needs some GCC attributes to specify what it is?


More information about the grass-dev mailing list