我目前正在使用arm env在Intel x118平台上工作。我发现我必须强制打开此选项以确保链接没有问题,否则,将发生如下错误:

Error: L6242E: Cannot link object iui_os_irq_msk.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object iui_os.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_critical_section.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_thread.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_event.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_event_group.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_queue.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_sem.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_common.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Error: L6242E: Cannot link object uta_os_mem.o as its attributes are incompatible with the image attributes.
   ... packed-enum clashes with enum_is_int.
Not enough information to list image symbols.
Not enough information to list the image map.
Finished: 13 information, 0 warning and 11 error messages.


有人可以告诉我,此--enum_is_int选项是否会对我的目标文件产生重大影响?

更多信息:

我发现了一些关于ARM的评论:

--enum_is_int


此选项强制所有枚举类型的大小至少为四个字节。

默认情况下,此选项处于关闭状态,并且使用了最小的数据类型,该数据类型可以容纳所有枚举器的值。

如果在命令行上指定ARM Linux配置文件,则默认情况下此选项为打开状态。

注意
不建议一般使用--enum_is_int选项。

最佳答案

该选项可能会稍微增加代码的内存占用量,但可能不会明显增加。它是安全使用的,在这种情况下是必需的,因为链接器不会链接对象,因为它们被认为是不兼容的。

也就是说,您可以使用--diag-warning = 6242命令行选项来覆盖链接器错误,但是生成的图像可能无法正常工作。

关于c - enum_is_int选项,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12453241/

10-11 22:59
查看更多