On Tue, 2022-06-14 at 08:29 +0000, Julien Blanc via Xenomai wrote:
> 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.
> 
> (following untested, although it should be ok, pretty straightforward)
> 
>     Fix fallthrough macro
>     
>     Signed-off-by: Julien Blanc <[email protected]>
> 
> diff --git a/vendor/evl/compiler.h b/vendor/evl/compiler.h
> index fce2766..8e6ad8c 100644
> --- a/vendor/evl/compiler.h
> +++ b/vendor/evl/compiler.h
> @@ -61,7 +61,7 @@
>  #endif
>  
>  #ifndef __fallthrough
> -#define fallthrough    __attribute__((__fallthrough__))
> +#define __fallthrough  __attribute__((__fallthrough__))
>  #endif

Are there no users of "fallthrough"? The ifndef guard and the macro
name seem out of sync, yes, but if the macro is never used within the
evl code base, why do we define it?

Quick search tells me that there are users, so I expect compile errors
now.

>  
>  #ifndef __alloc_size
> 
> 

Reply via email to