This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug objc/50909] New: Process "#pragma options align=reset" correctly on Mac OS X
- From: "carsomyr at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 29 Oct 2011 05:02:53 +0000
- Subject: [Bug objc/50909] New: Process "#pragma options align=reset" correctly on Mac OS X
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50909
Bug #: 50909
Summary: Process "#pragma options align=reset" correctly on Mac
OS X
Classification: Unclassified
Product: gcc
Version: 4.6.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: objc
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: carsomyr@gmail.com
Created attachment 25656
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25656
The patch.
I recently discovered that this program
#include <IOKit/usb/USB.h>
#pragma pack(1)
int main() {
return 0;
}
#pragma options align=reset
doesn't compile and gives the error
too many #pragma options align=reset
Notice that the program includes "IOKit/usb/USB.h". In that file, pragmas are
used like:
#pragma pack(1)
...
#pragma options align=reset
This gives the error because "#pragma pack(1)" is invisible to the relevant
logic in "gcc/config/darwin-c.c". As such, I've attached a patch,
"patch-pragmas.diff", that unifies said logic with the main pragma logic in
"gcc/c-family/c-pragma.c".
If the currently observed behavior for the test program is the intended
behavior, please close this bug and ignore the patch.