paul-j-lucas / cdecl

Composing and deciphering C (or C++) declarations or casts, aka ‘‘gibberish.’’
GNU General Public License v3.0
90 stars 11 forks source link

build: resolve compile failure due to improper attribute syntax #23

Closed jengelh closed 2 years ago

jengelh commented 2 years ago
gcc [...] 
In file included from c_ast.h:35,
                 from parser.y:36:
c_operator.h:243:1: warning: 'nodiscard' attribute ignored [-Wattributes]
  243 | bool c_oper_is_ambiguous( c_operator_t const *op ) {
In file included from c_operator.h:36:
c_operator.h:243:1: error: expected identifier or '(' before '_Bool'
  243 | bool c_oper_is_ambiguous( c_operator_t const *op ) {

As per https://en.cppreference.com/w/c/language/declarations , C2X attributes must precede specifiers like "inline".

Fixes: #22