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
Forum Updated to NodeBB v4.3 + New Features

How to use packed attribute in mingw Compiler

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.4k 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 21 Oct 2020, 03:59 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

    J 1 Reply Last reply 21 Oct 2020, 10:12
    0
    • M ManiRon28
      21 Oct 2020, 03:59

      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

      J Offline
      J Offline
      JonB
      wrote on 21 Oct 2020, 10:12 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

      1/2

      21 Oct 2020, 03:59

      • Login

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