> Von: Philippe Gerum
> Gesendet: Dienstag, 4. Februar 2014 18:49
>
> On 02/04/2014 06:44 PM, Gilles Chanteperdrix wrote:
> > On 02/04/2014 06:39 PM, Philippe Gerum wrote:
> >> On 02/04/2014 06:32 PM, Gilles Chanteperdrix wrote:
> >>> On 02/04/2014 06:27 PM, Philippe Gerum wrote:
> >>>> If g++ chokes on the initializer part because it is outdated, then
> >>>> using
> >>>> old-fashioned ones may be an option. Actually, I find macroizing this
> >>>> definition quite bad.
> >>>>
> >>>> static const RT_TASK no_alchemy_task = {
> >>>> -    .handle = 0,
> >>>> -    .thread = 0
> >>>> +    handle: 0,
> >>>> +    thread: 0
> >>>>     };
> >>>
> >>> No, the previous version is better, it is standard compliant C and C++,
> >>> the second version is a gcc extension, which works only when compiling
> >>> C, if I remember correctly.
> >>>
> >>
> >> Recent g++ is happy with both (no -std forced though). But the former is
> >> allowed by the C++ parser only since recently.
> >>
> >
> > Well, on the other hand:
> > static const RT_TAKS no_alchemy_task;
> >
> > Will zero initialized the structure just as well...
> >
>
> In that case you will have the object exist in the .bss.

If different compiler versions find fault with different initializer styles and 
some initializer is wanted in either case due to the .bss issue, then perhaps a 
not designated initializer would do.

static const RT_TASK no_alchemy_task = { 0, 0 };

--
Best regards,
Dietmar Schindler
________________________________
manroland web systems GmbH -- Management Board: Eckhard Hoerner-Marass 
(Spokesman), Joern Gossé
Registered Office: Augsburg -- Trade Register: AG Augsburg -- HRB-No.: 26816 -- 
VAT: DE281389840

Confidentiality note:
This eMail and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you are not the intended recipient, you are hereby notified that any use or 
dissemination of this communication is strictly prohibited. If you have 
received this eMail in error, then please delete this eMail.

! Please consider your environmental responsibility before printing this eMail !
________________________________
_______________________________________________
Xenomai mailing list
Xenomai@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to