Hello,

The attached patch is a proposal to #undef offsetof before
the #define we do in ginclude/stddef.h, which prevents redefinition
warnings from dg tests passing -Wsystem-headers on systems which
provide a definition in system headers, such as VxWorks.

We have been using this for a while with gcc-11 based toolchains
for a wide range of configurations (linux and windows hosts, native
and cross, bare board or VxWorks for a range of CPUs).

This also passes build + sanity test with gcc-12 for
powerpc64-vxworks7r2, then full bootstrap + regression testing
for mainline on x86_64-linux.

Ok to commit?

Thanks in advance!

With Kind Regards,

Olivier

2022-09-30  Olivier Hainque  <hain...@adacore.com>
    
gcc/
       * ginclude/stddef.h: #undef offsetof before #define.

Attachment: 0003-undef-offsetof-before-defining-it-in-stddef.h.patch
Description: Binary data



Reply via email to