On 9/21/20 12:20 PM, Vaseeharan Vinayagamoorthy wrote:
After this patch, I am seeing this -Warray-parameter error:
In file included from ../include/pthread.h:1,
from ../sysdeps/nptl/thread_db.h:25,
from ../nptl/descr.h:32,
from ../sysdeps/aarch64/nptl/tls.h:44,
from ../include/errno.h:25,
from ../sysdeps/unix/sysv/linux/sysdep.h:23,
from ../sysdeps/unix/sysv/linux/generic/sysdep.h:22,
from ../sysdeps/unix/sysv/linux/aarch64/sysdep.h:24,
from <stdin>:1:
../sysdeps/nptl/pthread.h:734:47: error: argument 1 of type ‘struct
__jmp_buf_tag *’ declared as a pointer [-Werror=array-parameter=]
734 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask)
__THROWNL;
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from ../include/setjmp.h:2,
from ../nptl/descr.h:24,
from ../sysdeps/aarch64/nptl/tls.h:44,
from ../include/errno.h:25,
from ../sysdeps/unix/sysv/linux/sysdep.h:23,
from ../sysdeps/unix/sysv/linux/generic/sysdep.h:22,
from ../sysdeps/unix/sysv/linux/aarch64/sysdep.h:24,
from <stdin>:1:
../setjmp/setjmp.h:54:46: note: previously declared as an array ‘struct
__jmp_buf_tag[1]’
54 | extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask)
__THROWNL;
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
cc1: all warnings being treated as errors
The warning flags differences between the forms of array parameters
in redeclarations of the same function, including pointers vs arrays
as in this instance. It needs to be suppressed in glibc, either by
making the function declarations consistent, or by #pragma diagnostic.
(IIRC, the pointer declaration comes before struct __jmp_buf_tag has
been defined so simply using the array form there doesn't work without
defining the type first.)
I would expect the warning to be suppressed when using the installed
library thanks to -Wno-system-headers.
Martin
The build/host/target setup is:
Build: x86_64-linux-gnu (Ubuntu 18.04)
Host: x86_64-linux-gnu
Target: aarch64-none-linux-gnu, aarch64_be-none-linux-gnu,
arm-none-linux-gnueabi, arm-none-linux-gnueabihf
Kind regards
Vasee
On 20/09/2020, 01:02, "Gcc-patches on behalf of Martin Sebor via Gcc-patches"
<gcc-patches-boun...@gcc.gnu.org on behalf of gcc-patches@gcc.gnu.org> wrote:
On 9/17/20 4:38 PM, Joseph Myers wrote:
> On Wed, 16 Sep 2020, Martin Sebor via Gcc-patches wrote:
>
>> Attached is an updated revision of the patch. Besides the tweaks
>> above it also contains a cosmetic change to the warning issued
>> for mismatches in unspecified VLA bounds: it points at the decl
>> with more of them to guide the user to specify them rather than
>> make them all unspecified.
>
> The previous version of the patch had a while loop as previously
discussed
> to handle skipping multiple consecutive cdk_attrs.
>
> + next = pd->declarator;
> + while (next && next->kind == cdk_attrs)
> + next = next->declarator;
>
> This version is back to an "if", but I don't see anything else in the new
> version of that function that actually means the "if" would skip multiple
> consecutive cdk_attrs as desired.
>
> The patch is OK with the "while" restored there. If for some reason the
> "while" breaks something, we'll need to look in more detail at exactly
> what case isn't being handled correctly by "while".
I guess it was the result of an experiment, trying to see if I could
break it with the 'if'. I (hope I) put it back and pushed the whole
series. I had to squash patches 1 and 2 because of a dependency that
I had missed.
Thanks for the review, by the way. I think the signature validation
we've ended up with is quite a bit more comprehensive than the first
attempt.
Martin