Menu

#2114 gcc -fpack-struct does not work

OTHER
closed
nobody
Bug
duplicate
Unknown
False
2013-10-22
2013-10-21
Som-Som
No

It seems that gcc -fpack-struct option does not have any effect in MinGW with gcc 4.8.1-4. It used to work in old MinGW releases with gcc 4.6.

Find code piece I used for testing attached.

Output of the test code now:
bcd16 size: 32
i64 size: 8
i64 content: 4300000021
memcmp (bcd16): 0

Output of the test code should be:
bcd16 size: 8
i64 size: 8
i64 content: 6543210987654321
memcmp (int): 0

1 Attachments

Discussion

  • Som-Som

    Som-Som - 2013-10-21

    I just tried the same on Fedora Core 19, gcc-4.8.1-1-FC19. It works correctly, so gcc itself may be be fine. The issue is likely to be MinGW related.

     
    • Keith Marshall

      Keith Marshall - 2013-10-21

      No, I don't think so.

      This looks like GCC bug #52991 -- an upstream bug. I recall some recent discussion of it, but I'm having difficulty finding the reference; this may be a duplicate. In any case, we need an upstream resolution.

       
    • Keith Marshall

      Keith Marshall - 2013-10-21

      I recall some recent discussion of it, but I'm having difficulty finding the reference; this may be a duplicate.

      Found it! It is a duplicate, of [#2005].

       

      Related

      Issues: #2005

  • Keith Marshall

    Keith Marshall - 2013-10-21
    • status: unread --> closed
    • Resolution: none --> duplicate
     
  • Som-Som

    Som-Som - 2013-10-22

    Thank you for your help. Yep, -mno-ms-bitfields is the cure for my problem.

     
    • Keith Marshall

      Keith Marshall - 2013-10-22

      -mno-ms-bitfields is the cure for my problem.

      It may be a work around; it isn't a cure. The cure would require pressing the GCC folks to actually progress a resolution to bug #52991.