lkml.org 
[lkml]   [2020]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH glibc 1/3] glibc: Perform rseq registration at C startup and thread creation (v19)
Date
* Mathieu Desnoyers:

>> Like the attribute, it needs to come right after the struct keyword, I
>> think. (Trailing attributes can be ambiguous, but not in this case.)
>
> Nope. _Alignas really _is_ special :-(
>
> struct _Alignas (16) blah {
> int a;
> };
>
> p.c:1:8: error: expected ‘{’ before ‘_Alignas’
> struct _Alignas (16) blah {

Meh, yet another unnecessary C++ incompatibility. C does not support
empty structs, so I assume they didn't see the field requirement as a
burden.

> One last thing I'm planning to add in sys/rseq.h to cover acessing the
> rseq_cs pointers with both the UAPI headers and the glibc struct rseq
> declarations:
>
> /* The rseq_cs_ptr macro can be used to access the pointer to the current
> rseq critical section descriptor. */
> #ifdef __LP64__
> # define rseq_cs_ptr(rseq) \
> ((const struct rseq_cs *) (rseq)->rseq_cs.ptr)
> #else /* __LP64__ */
> # define rseq_cs_ptr(rseq) \
> ((const struct rseq_cs *) (rseq)->rseq_cs.ptr.ptr32)
> #endif /* __LP64__ */
>
> Does it make sense ?

Written this way, it's an aliasing violation. I don't think it's very
useful.

Thanks,
Florian

\
 
 \ /
  Last update: 2020-05-26 16:59    [W:0.044 / U:8.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site