Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not compile with -Werror option, cause of some macro problem #206

Open
NotZahar opened this issue Jun 28, 2024 · 2 comments
Open

Does not compile with -Werror option, cause of some macro problem #206

NotZahar opened this issue Jun 28, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@NotZahar
Copy link

NotZahar commented Jun 28, 2024

gcc 13 gives the following:

../lexy/lexy/dsl/punctuator.hpp:15:26: error: unnecessary parentheses in declaration of ‘period’ [-Werror=parentheses]
   15 |     inline constexpr auto(Name) = _##Name {}
      |                          ^~~~~~
../lexy/lexy/dsl/punctuator.hpp:17:1: note: in expansion of macro ‘LEXY_PUNCT’
   17 | LEXY_PUNCT(period, ".");
      | ^~~~~~~~~~
../lexy/lexy/dsl/punctuator.hpp:15:26: note: remove parentheses
   15 |     inline constexpr auto(Name) = _##Name {}
      |                          ^~~~~~
../lexy/lexy/dsl/punctuator.hpp:17:1: note: in expansion of macro ‘LEXY_PUNCT’
   17 | LEXY_PUNCT(period, ".");
      | ^~~~~~~~~~
../lexy/lexy/dsl/punctuator.hpp:15:26: error: unnecessary parentheses in declaration of ‘comma’ [-Werror=parentheses]
   15 |     inline constexpr auto(Name) = _##Name {}
      |                          ^~~~~~
../lexy/lexy/dsl/punctuator.hpp:18:1: note: in expansion of macro ‘LEXY_PUNCT’
   18 | LEXY_PUNCT(comma, ",");
      | ^~~~~~~~~~
../lexy/lexy/dsl/punctuator.hpp:15:26: note: remove parentheses
   15 |     inline constexpr auto(Name) = _##Name {}
      |                          ^~~~~~
../lexy/lexy/dsl/punctuator.hpp:18:1: note: in expansion of macro ‘LEXY_PUNCT’
   18 | LEXY_PUNCT(comma, ",");
      | ^~~~~~~~~~
../lexy/lexy/dsl/punctuator.hpp:15:26: error: unnecessary parentheses in declaration of ‘colon’ [-Werror=parentheses]
   15 |     inline constexpr auto(Name) = _##Name {}
      |                          ^~~~~~
../lexy/lexy/dsl/punctuator.hpp:19:1: note: in expansion of macro ‘LEXY_PUNCT’
   19 | LEXY_PUNCT(colon, ":");
      | ^~~~~~~~~~
../lexy/lexy/dsl/punctuator.hpp:15:26: note: remove parentheses
   15 |     inline constexpr auto(Name) = _##Name {}
      |                          ^~~~~~
../lexy/lexy/dsl/punctuator.hpp:19:1: note: in expansion of macro ‘LEXY_PUNCT’
   19 | LEXY_PUNCT(colon, ":");
      | ^~~~~~~~~~
...

May be this line (from punctuator.hpp:15):

inline constexpr auto(Name) = _##Name {}

Should be replaced by:

inline constexpr auto Name = _##Name {}
@foonathan
Copy link
Owner

Hm, I think then I had a warning about macro arguments not being parenthesized :D Can you do a PR with the fix and see what the CI system says? Thanks.

@foonathan foonathan added the bug Something isn't working label Jun 28, 2024
NotZahar added a commit to NotZahar/lexy that referenced this issue Jun 29, 2024
@NotZahar
Copy link
Author

#207

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants