[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Question on replacing macros with static inline functions
- From: Andrew Cagney <andrew.cagney@...>
- Date: Thu, 17 Nov 2022 16:35:32 -0500
On Mon, 14 Nov 2022 at 11:49, Brent Pappas <firstname.lastname@example.org> wrote:
> I see, that makes sense.
> Thanks for the quick reply.
I'd expect those macros to be around for some time:
- GCC didn't adopt C99 inline semantics until GCC 4.3 and that was
only released in 2008 https://gcc.gnu.org/gcc-4.3/
https://gcc.gnu.org/gcc-4.3/porting_to.html ); sticking with macros
avoids that compatibility headache
- putting the stubs in .c files works well with modern compilers (the
link-time optimizer will eliminate the call), older compilers don't
support this though and take a hit; sticking to macros avoids this
> From: Roberto Ierusalimschy <email@example.com>
> Sent: Monday, November 14, 2022 11:45 AM
> To: Lua mailing list
> Subject: Re: Question on replacing macros with static inline functions
> > I noticed that Lua code sometimes uses macros where a static inline function
> > would appear to work equally as well.
> > [...]
> > How interested would the Lua development team be in replacing such macros with
> > functions in the future?
> Inline functions is not present in C89, and Lua is (still) compatible
> with C89.
> -- Roberto