struct siginfo vs. siginfo_t (was: GNU C Library master sources branch, master, updated. glibc-2.15-229-g4efeffc)

H.J. Lu hjl.tools@gmail.com
Thu Mar 15 16:25:00 GMT 2012


On Thu, Mar 15, 2012 at 8:57 AM, Carlos O'Donell
<carlos@systemhalted.org> wrote:
> On Thu, Mar 15, 2012 at 11:05 AM, Thomas Schwinge
> <thomas@codesourcery.com> wrote:
>> Hi!
>>
>> On 26 Feb 2012 18:17:52 -0000, drepper@sourceware.org wrote:
>>> http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4efeffc1d583597e4f52985b9747269e47b754e2
>>>
>>> commit 4efeffc1d583597e4f52985b9747269e47b754e2
>>> Author: Ulrich Drepper <drepper@gmail.com>
>>> Date:   Sun Feb 26 13:17:27 2012 -0500
>>>
>>>     Fix up POSIX testing in conformtest
>>
>>> [...]
>>> +     * sysdeps/unix/sysv/linux/bits/siginfo.h: Don't name siginfo_t
>>> +     struct.  [...]
>>> [...]
>>
>>> diff --git a/sysdeps/unix/sysv/linux/bits/siginfo.h b/sysdeps/unix/sysv/linux/bits/siginfo.h
>>> index ecef39d..0635e2f 100644
>>> --- a/sysdeps/unix/sysv/linux/bits/siginfo.h
>>> +++ b/sysdeps/unix/sysv/linux/bits/siginfo.h
>>> [...]
>>> @@ -47,7 +47,7 @@ typedef union sigval
>>>  #  define __SI_PAD_SIZE     ((__SI_MAX_SIZE / sizeof (int)) - 3)
>>>  # endif
>>>
>>> -typedef struct siginfo
>>> +typedef struct
>>>    {
>>>      int si_signo;            /* Signal number.  */
>>>      int si_errno;            /* If non-zero, an errno value associated with
>>> [...]
>>
>> This change breaks GCC:
>>
>>    In file included from /scratch/tschwing/FM_sh-linux-gnu-mk2/src/gcc-mainline/libgcc/unwind-dw2.c:377:0:
>>    ./md-unwind-support.h: In function 'sh_fallback_frame_state':
>>    ./md-unwind-support.h:182:17: error: field 'info' has incomplete type
>>
>> In my case, this is really libgcc/config/sh/linux-unwind.h:
>>
>>    [...]
>>       181            struct rt_sigframe {
>>       182              struct siginfo info;
>>       183              struct ucontext uc;
>>       184            } *rt_ = context->cfa;
>>    [...]
>
> POSIX says you get "siginto_t" *not* "struct siginfo," please fix the code.
>

"struct siginfo" may not work correctly for Linux/x32
and siginfo_t does since siginfo_t has an alignment
attribute, which isn't applied to "struct siginfo".


-- 
H.J.



More information about the Gcc-patches mailing list