[GRASS-dev] r.mapcalc: warning: field width should have type 'int', but argument has type 'yy_size_t'

Hi,

compiling relbranch70 (likely the same on trunk), I got

mapcalc.tab.c:1995:18: warning: passing 'const char *' to parameter of
type 'char *' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
        yyerror (yymsgp);
                 ^~~~~~
mapcalc.y:78:20: note: passing argument to parameter 's' here
void yyerror(char *s);
                   ^
mapcalc.l:218:38: warning: field width should have type 'int', but
argument has type 'yy_size_t' (aka 'unsigned long') [-Wformat]
                        fprintf(stderr, "syntax error: '%*s'\n",
yyleng, yytext);
                                                        ~~^ ~~~~~~
1 warning generated.
1 warning generated.

Not sure if and how to fix that.

Markus

Markus Neteler wrote:

compiling relbranch70 (likely the same on trunk), I got

Try r67518.

--
Glynn Clements <glynn@gclements.plus.com>

On Thu, Jan 7, 2016 at 6:43 PM, Glynn Clements <glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

compiling relbranch70 (likely the same on trunk), I got

Try r67518.

Issue gone, thanks.

I spotted another single one:

lib/db/sqlp/sqlp.tab.c

gcc -O2 -march=native -fdiagnostics-color -fPIC
-I/home/neteler/software/grass71/dist.x86_64-pc-linux-gnu/include
-I/home/neteler/software/grass71/dist.x86_64-pc-linux-gnu/include
-DPACKAGE=\""grasslibs"\"
-I/home/neteler/software/grass71/dist.x86_64-pc-linux-gnu/include
-I/home/neteler/software/grass71/dist.x86_64-pc-linux-gnu/include
-DRELDIR=\"lib/db/sqlp\" -o OBJ.x86_64-pc-linux-gnu/sqlp.tab.o -c
sqlp.tab.c
'sqlp.tab.c:' In function ‘'yyparse'’:
'sqlp.tab.c:1923:18:' warning: 'passing argument 1 of ‘'yyerror'’
discards ‘'const'’ qualifier from pointer target type
[-Wdiscarded-qualifiers]
         yyerror (yymsgp);
                     ^'
In file included from
'/home/neteler/software/grass71/dist.x86_64-pc-linux-gnu/include/grass/sqlp.h:110:0',
                 from 'sqlp.y:25':
'/home/neteler/software/grass71/dist.x86_64-pc-linux-gnu/include/grass/defs/sqlp.h:5:6:'
note: 'expected ‘'char *'’ but argument is of type ‘'const char *'’
void yyerror(char *s);
                     ^'

Markus

Markus Neteler wrote:

>> compiling relbranch70 (likely the same on trunk), I got
>
> Try r67518.

Issue gone, thanks.

I spotted another single one:

lib/db/sqlp/sqlp.tab.c

r67559

--
Glynn Clements <glynn@gclements.plus.com>

On Mon, Jan 11, 2016 at 9:31 PM, Glynn Clements
<glynn@gclements.plus.com> wrote:

Markus Neteler wrote:

>> compiling relbranch70 (likely the same on trunk), I got
>
> Try r67518.

Issue gone, thanks.

I spotted another single one:

lib/db/sqlp/sqlp.tab.c

r67559

No more warnings also here, thanks.

Backported in r67560.

Markus