Namespace pollution due to compiler.h in Xenomai 3.1
jan.kiszka at siemens.com
Fri Mar 13 15:42:29 CET 2020
On 13.03.20 15:22, Wolfgang Denk wrote:
> In message <20200313141229.7C87C24003E at gemini.denx.de> I wrote:
>>>> We noticed because out application also defines __packed...
>>> That's indeed bad style which I didn't realize so far. All those
>>> short-hands should be prefixed, e.g. like qt does (Q_NORETURN, Q_LIKELY
>> Was there not a rule in ANSI C that the use of double underscores in
>> identifiers is reserved compiler internal definitions? I would expect
>> that it's ok in compiler.h but incorrect in any application headers.
> For example C99 section 7.1.3 (see ):
> All identifiers that begin with an underscore and either an
> uppercase letter or another underscore are always reserved
> for any use.
>  https://busybox.net/~landley/c99-draft.html#7.1.3
> So IMHO any definition of __packed... in application code is not
> standard conforming.
That is correct as well and should be fixed in their application.
Still, I don't think Xenomai should use such defines on its own when
other libs avoid this as well.
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
More information about the Xenomai