Julien Blanc <[email protected]> writes:

> Le mardi 14 juin 2022 à 10:04 +0200, Philippe Gerum a écrit :
>> Julien Blanc <
>> [email protected]
>> > writes:
>> 
>> > Le mardi 14 juin 2022 à 08:54 +0200, Philippe Gerum a écrit :
>> > > Julien Blanc via Xenomai 
>> > > > #define __fallthrough  __attribute__((fallthrough))
>> > > > 
>> > > 
>> > > 6.39. attribute syntax
>> > > https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax
>> > > 
>> > > 
>> > 
>> > Not sure what you mean with this link. The relevant attribute is
>> > documented here: 
>> > https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html
>> > 
>> > 
>> > > PS: fixes go with patches.
>> > 
>> > Indeed, but i'll let Russel do this one as i don't have the
>> > opportunity
>> > to test it right now.
>> > 
>> 
>> The documentation (paragraph 6.39) states that "You may optionally
>> specify attribute names with ‘__’ preceding and following the name.
>> This allows you to use them in header files without being concerned
>> about a possible macro of the same name. For example, you may use the
>> attribute name __noreturn__ instead of noreturn.".
>> 
>> This is generally used with C attributes as a precaution against
>> namespace conflicts in the C language space. IOW, making a C++ parser
>> happy is ok with me as long as this does not introduce potential
>> issues down the road with regular C code.
>
> Missed that part, thanks. The issue here is thus not within the
> attribute part, which can be either fallthrough or __fallthrough__, but
> only in the macro name, which should be __fallthrough instead of just
> fallthrough.

Fine by me now, two remarks though: as Florian noted, this patch breaks
all current users in libevl, plus a meaningful commit log explaining why
such change is needed would helpful for reviewers.
(e.g. fixing conflict with C++ [[fallthough]], and maybe at some point
in the future with the C2X standard).

-- 
Philippe.

Reply via email to