Instruct XDC to treat enums as integer [message #511668] |
Tue, 02 February 2010 08:44  |
Eclipse User |
|
|
|
Hi,
I am faced with a problem on packed enums, by default the enums are converted to short integers. This could potentially break my software. I want to instruct XDC to treat enums as integers.
As per XDC documentation, its possible to do so by specifying "M3.model.shortEnums = false;" where M3 is a variable of type ti.targets.arm.elf.M3 in config.bld
When built with this modification, I get following error.
"E:/Work/packages/config.bld", line 26: XDC
runtime error: ti.targets.arm.elf.M3/model: 'shortEnums' is sealed
.interfaces files complete: Tue Feb 2 19:10:24 IST 2010.
Could you please help me out with this? I am using RTSC/XDC versioned 3.16.01.27
Thanks,
Sujith
|
|
|
|
|
Re: Instruct XDC to treat enums as integer [message #512397 is a reply to message #511668] |
Thu, 04 February 2010 17:12   |
Eclipse User |
|
|
|
The whole 'shortEnums' functionality is added because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=289018.
By default, TI's Arm compiler packs enums. That can be verified by looking into the section $build.attributes, and decoding it as specified in the section 2.3.6.2 The procedure call-related attributes, in http://infocenter.arm.com/help/topic/com.arm.doc.ihi0045c/IH I0045C_ABI_addenda.pdf.
The TI Arm compiler has the option --enum_type=unpacked,int,packed, designate enum type (Default is packed for EABI). If we were passing that option for our M3 target, shortEnum would be false. I don't know if there is a good reason that we should, but the linker would certainly complain if the object files with different enum options were linked together. That means that the different shortEnum options require two different M3 targets.
[Updated on: Thu, 04 February 2010 17:53] by Moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03770 seconds