Q:

Is it a good practice to redefine unavailable keywords as macros?

Is it a good practice to redefine unavailable keywords with macros?
I use GCC 4.8 in one of my projects which isn't exactly C11 standard compatible. At least not the extent of 4.9. But there are some cases where I'd like to use the modern static_assert to statically assert some expression at compile time which isn't supported in GCC 4.8 yet.
#if (__STDC_VERSION__ < 201112L) && !defined(__cplusplus) && !defined(static_assert)
#define static_assert(e, msg)       ((void)char[(e)? 1: -1])
#endif

I went through C11 standard where it says we shouldn't use keywords for any other purpose. It also states static_assert is a macro defined in assert.h. It was a bit confusing to interpret. To avoid any difficulty porting in future, I had it wrapped inside a #if check to ensure it's not C11 before defining that macro.
So is it a good practice to redefine unavailable keywords as macros that provide near similar behaviour?
Note, please don't suggest that I upgrade my compiler. It's not easy in an embedded environment.

A:

If you really do mean "near similar" not "exactly the same", then no, it isn't a good practice, as you risk code breaking a year or decade from now when the project gets updated to use a C11 standard compiler.  "Near similar" means things my break in a confusing and difficult to trace manner, causing much head scratching for whoever comes to own the project.
Much better is to implement the macro in a way that clearly denotes it is implementing that behavior, but with a different name, for instance, like proj_static_assert.  This will continue to work when you get to C11, but can be easily replaced with static_assert.  Since the replacement is thus deliberate, it's more likely you'll test for expected behavior in the macro, rather than suddenly seeing weird behavior when the compiler is upgraded.
I think the only way it might be a good idea is if you deliberately copy the code from a C11 compliant compiler into your project, but even then, its questionable.

