diff options
author | Dan Willemsen <dwillemsen@google.com> | 2018-11-01 12:53:32 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2018-11-01 12:53:32 -0700 |
commit | 90976cf2fc0200434a631ea01304675d9efc7b98 (patch) | |
tree | 0ff17bc9e4b3da99f843f37ddbb818b79a16dc76 | |
parent | dc1ffa73d10cef88afdbee90a6bd84f28ab69b82 (diff) | |
download | bison-90976cf2fc0200434a631ea01304675d9efc7b98.tar.gz |
Fix mesa3d build w/C and __has_cpp_attribute
As long as we're building with C++, the compiler is supposed to ignore
unknown attributes, so we can remove the current ifdef. Also switch to
the standard [[fallthrough]] rather than the clang specific one.
Test: build mesa3d
Change-Id: Ic1545e89bf0f9585a38979fafc0562161403a103
-rw-r--r-- | data/glr.c | 4 | ||||
-rw-r--r-- | data/lalr1.cc | 4 | ||||
-rw-r--r-- | data/yacc.c | 4 |
3 files changed, 5 insertions, 7 deletions
@@ -635,8 +635,8 @@ yytnamerr (char *yyres, const char *yystr) if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ -#if defined(__has_cpp_attribute) && __has_cpp_attribute(clang::fallthrough) - [[clang::fallthrough]]; +#ifdef __cplusplus + [[fallthrough]]; #endif default: if (yyres) diff --git a/data/lalr1.cc b/data/lalr1.cc index c6e19777..06f0dedf 100644 --- a/data/lalr1.cc +++ b/data/lalr1.cc @@ -376,9 +376,7 @@ do { \ if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ -#if defined(__has_cpp_attribute) && __has_cpp_attribute(clang::fallthrough) - [[clang::fallthrough]]; -#endif + [[fallthrough]]; default: yyr += *yyp; break; diff --git a/data/yacc.c b/data/yacc.c index 17ad67c0..0f881d8d 100644 --- a/data/yacc.c +++ b/data/yacc.c @@ -1209,8 +1209,8 @@ yytnamerr (char *yyres, const char *yystr) if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ -#if defined(__has_cpp_attribute) && __has_cpp_attribute(clang::fallthrough) - [[clang::fallthrough]]; +#ifdef __cplusplus + [[fallthrough]]; #endif default: if (yyres) |