[ccan] ccan and C standards newer than gnu89

Rusty Russell rusty at rustcorp.com.au
Mon Aug 24 11:23:26 AEST 2015


Cody P Schafer <dev at codyps.com> writes:
>>>> It *can* generally be made built time configurable, but it usually
>>>> requires ugly macros scattered in an unpleasantly large number of
>>>> locations.
>>>
>>>
>>> That sounds unpleasant.  Perhaps we publicise a version or tag of ccan that
>>> is "old compiler compliant" and people just pull that older version.  If
>>> it's missing functionality they require from later ccan versions, their
>>> backport patches are welcome :)
>>>
>>
>> When I first tried to get the module in question merged (which needed
>> c99-inline), after the initial rejection I looked at adding a
>> configurator test for the style of inline supported. Unfortunately, I
>> couldn't find a way to check the style of inline without needing to
>> build more than 1 source file (and then link them together), which
>> would have required more restructuring to configurator than I was
>> willing to do.
>
> I suppose a workaround here would be to probe some defines (like the
> STDC_VERSION one) to avoid needing to change configurator too much.
> Perhaps that probing could even be done directly in an "inline"
> module.

Yes, I'm happy with #ifdefs for tests, even if they go into config.h to
boil it down to a handful of HAVE_xxx for modules.  Frankly, whatever
works.

Runtime testing is needed for some things (like presence of a library
unless you have gcc 5's __has_include magic), and seemed the easy path
for other things, but it's not a religion.

Thanks!
Rusty.


More information about the ccan mailing list