This is the mail archive of the gcc-bugs@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]

[Bug objc/50909] New: Process "#pragma options align=reset" correctly on Mac OS X


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.


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