On 4/21/2011 4:34 AM, Francois Grieu wrote:
> On 20/04/2011 20:04, Tim Rentsch wrote:
>> Francois Grieu<> writes:
>>
>>> Under C89/90/99, there is no static assert allowing to check a
>>> constant expression at compile time. I often use
>>>
>>> #define ASSERT_S(condition) extern char assert_failure[(condition)?1:-1]
>>> [...]
>>> But on some platforms there is a spurious warning or link time error
>>> (which I can't remember, and that would be OT). [snip alternatives]
>>
>> Any reason you can't simply add a definition (perhaps in its
>> own separate .c file) for the symbol in question? [...]
>
> I remember using this workaround,[...]
Peculiar use of "workaround," don't you think? You promise the
compiler that some other compilation unit defines `assert_failure',
and it's a "workaround" to provide the promised definition? And the
complaint when you renege on your promise is "spurious?"
Ever hear the one about the guy who murdered his parents and
asked the court for mercy because he was an orphan?
--
Eric Sosman
d