[pacman-dev] [PATCH] package.c, fix incorrect buffersize

Pierre Neidhardt ambrevar at gmail.com
Mon Nov 2 12:46:56 UTC 2015


On 15-11-02 21:50:20, Allan McRae wrote:
> On 02/11/15 20:55, Pierre Neidhardt wrote:
> > On 15-11-02 11:49:31, Rikard Falkeborn wrote:
> >> Den 2 nov 2015 08:47 skrev "Pierre Neidhardt" <ambrevar at gmail.com>:
> >>>
> >>> Since you caught the issue, Rikard, do you want to do send the patch?
> >>>
> >>> --
> >>> Pierre Neidhardt
> >>
> >> Was there a problem with the original patch I sent? If it needs changes or
> >> be resubmitted, I wont be able to do it within a couple of days so feel
> >> free to do it if you like.
> >>
> >> Rikard
> > 
> > Your original patch was working. It's just that I think we can spare the 2
> > #defines.
> > 
> > I'll submit the patch then.
> > 
> 
> Sort of...  it fixed one issue but the warning given by clang still
> remained.

Are you talking about the original patch? You said yourself:

> This is actually not the cause of the warning from clang...   But it
> does fix it (unlike all the other suggestions in the thread).


> package.c:95:34: error: variable length array folded to constant array as an
>       extension [-Werror,-Wgnu-folding-constant]
>         wchar_t wbuf[ARRAYSIZE(titles)][TITLE_MAXLEN + title_suffix_len];
>                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> package.c:81:22: note: expanded from macro 'TITLE_MAXLEN'
> #define TITLE_MAXLEN 50
>                      ^

Both the original patch and my last simplified version fix the
gnu-folding-constant warning. Am I missing something?

-- 
Pierre Neidhardt


More information about the pacman-dev mailing list