[Ecls-list] C99

Andy Hefner ahefner at gmail.com
Sun Feb 19 11:54:48 UTC 2012

On Sat, Feb 18, 2012 at 6:22 PM, Andy Hefner <ahefner at gmail.com> wrote:
> With
> "-std=c99" enabled, I'd see a mix of calls to things like "_ecl_car"
> that don't link, alongside the correct "ecl_car".  I don't understand
> how GCC's C99 support affects identifier names, but there's probably a
> simple fix for this.

Oh, how silly of me. It had nothing to do with symbol prefixes, but
rather the inline versions of these built-in functions: the
conditional expression determining ECL_CAN_INLINE fails in C99 mode,
converting these to external symbols, inconsistent with how the
library was built - _ecl_car and the like aren't defined at all if
ECL_CAN_INLINE is true when the shared library is built.

I've attached a patch which changes the conditional in config.h to
test GCC's __GNUC_GNU_INLINE__ and __GNUC_STDC_INLINE__ macros for
deciding ECL_CAN_INLINE. I've tried ECL built in default (gnu90) and
c99 modes, and in both cases ECL_CAN_INLINE is true as expected and my
inline C99 code works. This should still do the right thing for strict
C89/C90 modes, but I haven't tested it.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecl-can-inline-gcc.diff
Type: text/x-patch
Size: 589 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20120219/bbe13b9a/attachment.bin>

More information about the ecl-devel mailing list