Just because a bit of C code compiles without diagnostics as C++ does not mean the code is safe. C++ does not have compound literals, but the syntax for a compound literal is accepted in several C++ compilers, including GCC and clang. However, in C compound literals have block-scoped lifetime, whereas C++ compilers give them expression-scoped lifetime. This means you can have silent use-after-free issues when using a C++ compiler. And, yes, I have encountered this (after diagnosing some read and write overflows in Valgrind and ASAN) and now try not to use compound literals in header files unless guarded to prevent accidental use with C++ compilers), though unfortunately this was a one of my later hard earned lessons.
Indeed, every C compiler including gcc is slightly different. Especially in the embedded space where pseudo-standards become a small subset of GNU compatible code very quickly. To be honest, gcc became the unofficial standard even with the GNU extensions.
Good C follows the 10 rules, uses old compatible macro language features, and is boring to trivially port. The "hold my beer" folks often go back to Python where the abstractions hide the foot-guns.
https://en.wikipedia.org/wiki/The_Power_of_10:_Rules_for_Dev...