lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Mon, 14 Nov 2022 at 11:49, Brent Pappas <pappasbrent@knights.ucf.edu> 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 <roberto@inf.puc-rio.br>
> 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