[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Allow Bison-generated C++ parsers to compile with -fno-excep
From: |
Akim Demaille |
Subject: |
Re: [PATCH] Allow Bison-generated C++ parsers to compile with -fno-exceptions. |
Date: |
Fri, 17 Aug 2018 07:33:56 +0200 |
> Le 16 août 2018 à 07:36, Akim Demaille <address@hidden> a écrit :
>
>> Le 16 août 2018 à 07:22, Akim Demaille <address@hidden> 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).
c++-no-exceptions.diff
Description: Binary data