[RFC] Have assert macros

Dale Johannesen dalej@apple.com
Tue Aug 24 22:55:00 GMT 2004


On Aug 24, 2004, at 3:25 PM, Mark Mitchell wrote:
> Nathan Sidwell wrote:
>
>> Hi,
>> I did some measurements to determine how much leaving in our self 
>> checking
>> mechanism of the form
>>     if (expr)
>>       abort()
>> was costing us in compilation speed.  I built 4 --disable-checking
>> compilers, with the following tweaks
>> 0) baseline
>> 1) #define abort to no-op, thus allowing the optimizer can remove the
>> controlling expression
>> 2) #define abort to no-op and g++'s my_friendly_assert to no-op

Redefining abort is undefined behavior in C89 (4.1.2.1, footnote 91).
Of course we can switch to using gcc_abort, appropriately #define'd.



More information about the Gcc mailing list