[PATCH 1/2] score: Add RTEMS_WEAK

Gedare Bloom gedare at rtems.org
Thu Jul 23 23:02:38 UTC 2020


On Thu, Jul 23, 2020 at 11:54 AM Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
>
> On 23/07/2020 19:19, Gedare Bloom wrote:
>
> > We don't have any specific rule, but all the examples in GCC docs put
> > the attributes near the end of the line rather than in the
> > start/middle. I mentioned this related to Christian's recent patch
> > with alignment attributes. It might be good for us to define some
> > conventions for consistency. I lean toward following the GNU
> > documentation.
> >
> > ref:https://gcc.gnu.org/onlinedocs/gcc-4.7.2/gcc/Function-Attributes.html
>
> You can't put the attributes between the closing ) and the opening { in
> a function definition.
>
> https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Attribute-Syntax.html#Attribute-Syntax
>
> I tend to place them in front of the declarator. This is in line with C++11:
>
> https://en.cppreference.com/w/cpp/language/attributes
>
> This enables you to replace some GNU-specific attributes with C++
> attributes for example.
>
That is a good rationale.

> Also the C11 _Noreturn is in front of the function declaration:
>
> https://en.cppreference.com/w/c/language/_Noreturn
>

Thanks, I just was thinking about making things consistent (from the
beginning this time).

-Gedare


More information about the devel mailing list