[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Question on replacing macros with static inline functions
- From: Sean Conner <sean@...>
- Date: Thu, 17 Nov 2022 04:21:47 -0500
It was thus said that the Great Philippe Verdy once stated:
> May be there's a way to configure macros to detect support of incline
> functionsso that they replace the macro expression by a function call. This
> would allow better type analyses on platforms with C99 compatibility and
> linting, including unsafe or unchecked typecasts and conversions, causing
> undefined behaviors.
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# define macro(x) ...
#elif __STDC_VERSION__ >= 199901L
static inline int macro(x) { ... }
#endif
-spc