conversion of the __inline__ and inline pragmas to RTEMS_INLINE_ROUTINE?

Peter Dufault dufault at hda.com
Wed Nov 9 23:31:11 UTC 2011


On Nov 9, 2011, at 10:31 , Sebastian Huber wrote:

> How do you want to deal with designated initializers?

My preference: They should never be in headers.  They can be in .c files.  Extern const references to something that resolves to a designated initializer in a .c file is OK.  And when they do appear in headers even though they never should they need to be bracketed with #ifndef __cplusplus__

Rationale: They don't play with C++, and there's no good way to put them in a header and have them play with C++.  Giving an instance a clear extern name e.g.:

typedef struct something_or_other {
	/* Gory details here. */
} something_or_other;

extern const something_or_other convenient_well_known_initializer;

and then initializing convenient_well_known_initializer in a .c file with designated initializer notation works OK.

Peter
-----------------
Peter Dufault
HD Associates, Inc.      Software and System Engineering





More information about the users mailing list