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 target/52991] [6/7/8 Regression] attribute packed broken on mingw32?


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)

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