This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

“error: too many #pragma options align=reset” on mac with gcc 4.8


I posted this question on stack overflow but did not get any help.

I used macports to update gcc to version 4.8.1. I would like to use
that version to build libusbx 1.0.17. But when I './configure' and
then 'make' libusbx I get "error: too many #pragma options
align=reset" (see error bellow), and it fails to build. If I configure
libusbx with 'CC=clang ./configure' and then 'make' it works fine but
that is building with gcc 4.2, and that is not what I want. Is there
any way to build libusbx with gcc 4.8 on mac?

Reading through gcc docs
(http://gcc.gnu.org/onlinedocs/gcc/Pragmas.html) it seems that gcc
understands both "#pragma pack(1)" and "#pragma options align=reset,"
so I am not sure why I am getting this error. It seems to be related
to this bug - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50909, but I
am not sure since this is an old bug and gcc 4.2 that comes with mac
works. I am looking for a way to edit the header file, I do not want
to patch and rebuild gcc. Thanks for any suggestions.

In USB.h file the pragma's are in this form.

#pragma pack(1)
... struct ....
#pragma options align=reset

What is the equivalent that works with gcc 4.8? They all seem to be
paired correctly, so the issue must be that gcc 4.8 does not
understand one or the other.

==========================================
make  all-recursive
Making all in libusb
  CC       libusb_1_0_la-core.lo
  CC       libusb_1_0_la-descriptor.lo
  CC       libusb_1_0_la-io.lo
  CC       libusb_1_0_la-strerror.lo
  CC       libusb_1_0_la-sync.lo
  CC       libusb_1_0_la-hotplug.lo
  CC       os/libusb_1_0_la-threads_posix.lo
  CC       os/libusb_1_0_la-darwin_usb.lo
In file included from
/System/Library/Frameworks/IOKit.framework/Headers/usb/IOUSBLib.h:27:0,
                 from os/darwin_usb.h:27,
                 from os/darwin_usb.c:43:
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:576:9:
error: too many #pragma options align=reset
 #pragma options align=reset
         ^
In file included from
/System/Library/Frameworks/IOKit.framework/Headers/usb/IOUSBLib.h:27:0,
                 from os/darwin_usb.h:27,
                 from os/darwin_usb.c:43:
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:746:9:
error: too many #pragma options align=reset
 #pragma options align=reset
         ^
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:797:9:
error: too many #pragma options align=reset
 #pragma options align=reset
         ^
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:815:9:
error: too many #pragma options align=reset
 #pragma options align=reset
         ^
/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:835:9:
error: too many #pragma options align=reset
 #pragma options align=reset
         ^
os/darwin_usb.c: In function 'darwin_get_device_descriptor':
os/darwin_usb.c:58:76: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]
 #define DARWIN_CACHED_DEVICE(a) ((struct darwin_cached_device *)
(((struct darwin_device_priv *)((a)->os_priv))->dev))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]