# from Sisyphus
# on Saturday 16 June 2007 05:11 pm:
>You can see that a function called 'foo' will be visible to the
> compiler even if RUBBISH is not defined - and that's what leads to
> the error for me. Looks like some compilers/linkers must be
> smart/dumb enough to ignore the reference to 'foo' - but mine
> certainly aren't. I've just tried running the script using
> Microsoft's 'cl' compiler, and the same thing still happens.
Ah, I see what you're getting at. I have the same foo() in my generated
file, but my gcc is 3.3.5 and 4.1.2 (both make no trouble, but might
have something to say about it with warnings on?)
It appears that this is a bug in inline's parser (where it doesn't check
ifdefs when generating the xs code.) (I seem to remember a mention of
something like that in the docs.) However, I think we might be stuck
with that barring a reimplementation of the preprocessor or something
similarly large and difficult (I think if you just did `cc -E`, the
definition would go poof, but you would then be generating code for
anything that's been included (though I think cpp leaves some hints
lying around about file and line numbers -- but it seems this would be
implementation independent.)) Oops, I've now exhausted my
pseudo-relevant and questionably-correct knowledge.
--Eric
--
If the collapse of the Berlin Wall had taught us anything, it was that
socialism alone was not a sustainable economic model.
--Robert Young
---------------------------------------------------
http://scratchcomputing.com
---------------------------------------------------