This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/52991] [6/7/8 Regression] attribute packed broken on mingw32?
- From: "dev at benjarobin dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 28 Feb 2018 20:32:05 +0000
- Subject: [Bug target/52991] [6/7/8 Regression] attribute packed broken on mingw32?
- Auto-submitted: auto-generated
- References: <bug-52991-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52991
--- Comment #34 from Benjamin Robin <dev at benjarobin dot fr> ---
Thank you a lot for the fix.
I have no idea what I did yesterday when I did test bf-ms-layout-2.c (Yes the
test was wrong, and by default cannot compile under Visual Studio VC)
The test can be slightly improved by replacing:
#ifdef __GNUC__
#define ATTR __attribute__ ((ms_struct))
#endif
By:
#ifdef __GNUC__
# ifdef _TEST_MS_LAYOUT
# define ATTR __attribute__ ((ms_struct))
# else
# define ATTR __attribute__ ((gcc_struct))
# endif
#else
# define ATTR
#endif
Otherwise the else branch of "#if defined (_TEST_MS_LAYOUT) || defined
(_MSC_VER)" cannot be tested easily.
And even more important, it can be directly compiled with Visual Studio VC (VC
does not known what is ATTR)