> Le 16 août 2018 à 07:36, Akim Demaille <[email protected]> a écrit :
> 
>> Le 16 août 2018 à 07:22, Akim Demaille <[email protected]> a écrit :
>> 
>> Would it be acceptable to introduce a new Bison directive to disable
>> exceptions?  Something like
>> 
>> %define api.exceptions no
> 
> Or maybe something like what you proposed, but with
> 
> #if defined __GNUC__ && !defined __EXCEPTIONS

I’m ambivalent on this.  The use of exceptions or not is clearly
a design decision of the author of the grammar, not a decision
left at c++-compile time.  So I tend to prefer a new Bison variable
to this end.  Unfortunately this variable should have been disabled
by default when the feature was introduced, but I suppose it’s too
late now to change the default value.

Setting a Bison variable to disable the support of exceptions
means more things to know for the users, while something
like what follows seems to do the right thing, but in a magical
way, and only for GCC (and I guess clang, which faithfully copies
all the macros of GCC).

Attachment: c++-no-exceptions.diff
Description: Binary data

Reply via email to