From: Ulya Trofimovich Date: Sat, 13 Jul 2019 18:09:00 +0000 (+0100) Subject: Cosmetic: shortened macro name a bit and removed 'GXX' as it is also relevant to... X-Git-Tag: 1.2~23 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b50f1bc3c415b37bead30058b8f2b2252b18511f;p=re2c Cosmetic: shortened macro name a bit and removed 'GXX' as it is also relevant to Clang. --- diff --git a/bootstrap/lib/lex.cc b/bootstrap/lib/lex.cc index 9375236f..f6778930 100644 --- a/bootstrap/lib/lex.cc +++ b/bootstrap/lib/lex.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 1.1.1 on Sat Jul 13 18:32:57 2019 */ +/* Generated by re2c 1.1.1 on Sat Jul 13 19:06:36 2019 */ #line 1 "../lib/lex.re" #include diff --git a/bootstrap/lib/parse.cc b/bootstrap/lib/parse.cc index d61d8114..413de35d 100644 --- a/bootstrap/lib/parse.cc +++ b/bootstrap/lib/parse.cc @@ -88,7 +88,7 @@ using namespace re2c; extern "C" { int yylex(const char *&pattern); -void yyerror(const char *pattern, const char*) RE2C_GXX_ATTRIBUTE((noreturn)); +void yyerror(const char *pattern, const char*) RE2C_ATTR((noreturn)); } // extern "C" diff --git a/bootstrap/src/parse/lex.cc b/bootstrap/src/parse/lex.cc index 10c77319..8f059a37 100644 --- a/bootstrap/src/parse/lex.cc +++ b/bootstrap/src/parse/lex.cc @@ -1,4 +1,4 @@ -/* Generated by re2c 1.1.1 on Sat Jul 13 18:25:08 2019 */ +/* Generated by re2c 1.1.1 on Sat Jul 13 19:06:36 2019 */ #line 1 "../src/parse/lex.re" #include #include "src/util/c99_stdint.h" diff --git a/bootstrap/src/parse/lex.h b/bootstrap/src/parse/lex.h index 7eed37b6..59e14a0e 100644 --- a/bootstrap/src/parse/lex.h +++ b/bootstrap/src/parse/lex.h @@ -1,4 +1,4 @@ -/* Generated by re2c 1.1.1 on Sat Jul 13 18:25:08 2019 */ +/* Generated by re2c 1.1.1 on Sat Jul 13 19:06:36 2019 */ #ifndef _RE2C_PARSE_LEX_ #define _RE2C_PARSE_LEX_ diff --git a/bootstrap/src/parse/parser.cc b/bootstrap/src/parse/parser.cc index 9c80a26a..b510beac 100644 --- a/bootstrap/src/parse/parser.cc +++ b/bootstrap/src/parse/parser.cc @@ -84,7 +84,7 @@ using namespace re2c; extern "C" { int yylex(context_t &context); -void yyerror(context_t &context, const char*) RE2C_GXX_ATTRIBUTE((noreturn)); +void yyerror(context_t &context, const char*) RE2C_ATTR((noreturn)); } // extern "C" diff --git a/lib/parse.ypp b/lib/parse.ypp index 9c9c7753..1288e38f 100644 --- a/lib/parse.ypp +++ b/lib/parse.ypp @@ -23,7 +23,7 @@ using namespace re2c; extern "C" { int yylex(const char *&pattern); -void yyerror(const char *pattern, const char*) RE2C_GXX_ATTRIBUTE((noreturn)); +void yyerror(const char *pattern, const char*) RE2C_ATTR((noreturn)); } // extern "C" diff --git a/lib/regexec_nfa_posix_backward.cc b/lib/regexec_nfa_posix_backward.cc index 020de2d3..407e8919 100644 --- a/lib/regexec_nfa_posix_backward.cc +++ b/lib/regexec_nfa_posix_backward.cc @@ -258,7 +258,7 @@ void closure_posix(psimctx_t &ctx) } static int32_t precedence(psimctx_t &ctx, const conf_t &x - , const conf_t &y RE2C_GXX_ATTRIBUTE((unused))) + , const conf_t &y RE2C_ATTR((unused))) { DASSERT(x.state == y.state); const size_t idx = index(x.state, ctx.nfa); diff --git a/lib/regexec_nfa_posix_kuklewicz.cc b/lib/regexec_nfa_posix_kuklewicz.cc index 649122a5..e7f06fff 100644 --- a/lib/regexec_nfa_posix_kuklewicz.cc +++ b/lib/regexec_nfa_posix_kuklewicz.cc @@ -275,8 +275,8 @@ int32_t khistory_t::precedence(ctx_t &ctx std::vector &p1 = ctx.history.path1, &p2 = ctx.history.path2; const int32_t - n1 RE2C_GXX_ATTRIBUTE((unused)) = subhistory_list(ctx.history, p1, x.thist, t), - n2 RE2C_GXX_ATTRIBUTE((unused)) = subhistory_list(ctx.history, p2, y.thist, t); + n1 RE2C_ATTR((unused)) = subhistory_list(ctx.history, p1, x.thist, t), + n2 RE2C_ATTR((unused)) = subhistory_list(ctx.history, p2, y.thist, t); DASSERT(n1 == n2); std::vector::const_reverse_iterator diff --git a/src/msg/msg.h b/src/msg/msg.h index 3905c8c5..d056317c 100644 --- a/src/msg/msg.h +++ b/src/msg/msg.h @@ -24,8 +24,8 @@ public: inline Msg(): filenames(), warn(*this), locfmt(LOCFMT_GNU) {} size_t register_filename(const std::string &filename); - void fatal(const loc_t &loc, const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 3, 4), noreturn)); - void warning(const char *type, const loc_t &loc, bool error, const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 5, 6))); + void fatal(const loc_t &loc, const char *fmt, ...) RE2C_ATTR((format (printf, 3, 4), noreturn)); + void warning(const char *type, const loc_t &loc, bool error, const char *fmt, ...) RE2C_ATTR((format (printf, 5, 6))); friend class Warn; @@ -35,8 +35,8 @@ private: void warning_end(const char *type, bool error); }; -void error(const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 1, 2))); -void fatal(const char *fmt, ...) RE2C_GXX_ATTRIBUTE ((format (printf, 1, 2), noreturn)); +void error(const char *fmt, ...) RE2C_ATTR((format (printf, 1, 2))); +void fatal(const char *fmt, ...) RE2C_ATTR((format (printf, 1, 2), noreturn)); void error_arg(const char *option); void usage (); void vernum (); diff --git a/src/parse/parser.ypp b/src/parse/parser.ypp index 9d9d9c93..faaad20c 100644 --- a/src/parse/parser.ypp +++ b/src/parse/parser.ypp @@ -19,7 +19,7 @@ using namespace re2c; extern "C" { int yylex(context_t &context); -void yyerror(context_t &context, const char*) RE2C_GXX_ATTRIBUTE((noreturn)); +void yyerror(context_t &context, const char*) RE2C_ATTR((noreturn)); } // extern "C" diff --git a/src/util/attribute.h b/src/util/attribute.h index 027a6072..27b531f4 100644 --- a/src/util/attribute.h +++ b/src/util/attribute.h @@ -2,9 +2,9 @@ #define _RE2C_UTIL_ATTRIBUTE_ #ifdef __GNUC__ -# define RE2C_GXX_ATTRIBUTE(x) __attribute__(x) +# define RE2C_ATTR(x) __attribute__(x) #else -# define RE2C_GXX_ATTRIBUTE(x) +# define RE2C_ATTR(x) #endif #endif // _RE2C_UTIL_ATTRIBUTE_ diff --git a/src/util/s_to_n32_unsafe.h b/src/util/s_to_n32_unsafe.h index 924850fc..01f01a1e 100644 --- a/src/util/s_to_n32_unsafe.h +++ b/src/util/s_to_n32_unsafe.h @@ -8,8 +8,8 @@ namespace re2c { -bool s_to_u32_unsafe (const char * s, const char * s_end, uint32_t & number) RE2C_GXX_ATTRIBUTE ((warn_unused_result)); -bool s_to_i32_unsafe (const char * s, const char * s_end, int32_t & number) RE2C_GXX_ATTRIBUTE ((warn_unused_result)); +bool s_to_u32_unsafe (const char * s, const char * s_end, uint32_t & number) RE2C_ATTR((warn_unused_result)); +bool s_to_i32_unsafe (const char * s, const char * s_end, int32_t & number) RE2C_ATTR((warn_unused_result)); } // namespace re2c