Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to use packed attribute in mingw Compiler

How to use packed attribute in mingw Compiler

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    ManiRon28
    wrote on last edited by
    #1

    I Have been facing an issue in which when i use #pragma pack and #pragma push packs my structure well in mingw compiler , where as when i use attribute(packed) it doesnt pack my structure , but in my case i want to use __attribute __ , is there any way possible to pack my structure

    JonBJ 1 Reply Last reply
    0
    • M ManiRon28

      I Have been facing an issue in which when i use #pragma pack and #pragma push packs my structure well in mingw compiler , where as when i use attribute(packed) it doesnt pack my structure , but in my case i want to use __attribute __ , is there any way possible to pack my structure

      JonBJ Online
      JonBJ Online
      JonB
      wrote on last edited by
      #2

      @ManiRon28
      From a couple of years ago at least there are posts stating that __attribute__ ((packed)) works in gcc but is "broken" in MinGW, and the suggested workaround is to use #pragma pack:

      https://stackoverflow.com/a/37199319/489865
      https://stackoverflow.com/a/31622291/489865
      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991

      1 Reply Last reply
      4

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved