poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] Add const to buffer param of pkl_parse_buffer


From: Jose E. Marchesi
Subject: Re: [PATCH 1/2] Add const to buffer param of pkl_parse_buffer
Date: Fri, 03 Apr 2020 16:48:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

    >      >      2020-04-02 Tim Rühsen  <address@hidden>
    >      >
    >      >              * src/pkl-parser.c (pkl_parse_buffer): Add const to 
buffer param.
    >      >              * src/pkl-parser.h (pkl_parse_buffer): Likewise.
    >      >
    >      > I just realized this change introduced a warning:
    >      >
    >      > ../../src/pkl-parser.c: In function 'pkl_parse_buffer':
    >      > ../../src/pkl-parser.c:141:10: warning: assignment discards 
'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    >      >       *end = buffer + parser->nchars;
    >
    >      Sorry, easy to miss when I use -Wall -Wextra (I'll propose a fix).
    >      Is there a recommend set of gcc flags to use to be in sync with you ?
    >
    > By default poke uses -Wall, but not -Wextra.
    >
    
    Just FYI, you will miss warnings like
    
    pk-repl.c: In function 'pk_repl':
    pk-repl.c:383:40: warning: suggest braces around empty body in an 'if'
    statement [-Wempty-body]
      383 |         /* Avoid gcc warning here.  */ ;

Heh that's funny :)

I will take a look to these warnings and fix the real problems.
Depending on what I find I will add -Wextra to CFLAGS.

Thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]