bug-gnulib
[Top][All Lists]
Advanced

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

Re: inline.m4: use compiler, not cpp


From: Paul Eggert
Subject: Re: inline.m4: use compiler, not cpp
Date: Sat, 11 Nov 2006 09:34:56 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Eric Blake <address@hidden> writes:

> What I should have done, of course, is:
> #if HAVE_INLINE
> static inline unsigned char to_uchar (char ch) { return ch; }
> #else
> # define to_uchar(C) ((unsigned char) (C))
> #endif

No, let's not go that route!  We should keep code simple, and not
sprinkle it with HAVE_INLINE all over the place.  We have too many
tests against HAVE_INLINE already.  Just use "static inline unsigned
char to_uchar (char ch) { return ch; }" and be done with it.  If
someone configures with CFLAGS=-fno-inline then they _want_ the
behavior you observe.

I don't think xalloc.h is a precedent here -- its use of HAVE_INLINE
is different.  But if it is, then I'd rather rip out its use of
HAVE_INLINE and go back to the simpler way of doing things.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]