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

Inconsistent use of diagnostic pragmas (-Wreturn-type) #9

Closed
hirrolot opened this issue Apr 9, 2021 · 0 comments
Closed

Inconsistent use of diagnostic pragmas (-Wreturn-type) #9

hirrolot opened this issue Apr 9, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@hirrolot
Copy link
Owner

hirrolot commented Apr 9, 2021

Currently, inside match99, we emit the ... diagnostic push and ... diagnostic ignored "-Wreturn-type" pragmas, but without otherwise99 we won't return to the previous diagnostics state:

https://github.com/Hirrolot/datatype99/blob/e4c8e4688612cb63e471d7f7f1dcd358089ed467/datatype99.h#L154

I've spent some time trying to figure out how to automatically resolve this warning but with no success; therefore, the best solution for now is just don't suppress -Wreturn-type but to force a user to suppress it, if necessary.

FYI: The -Wreturn-type warning can be emitted due to the following reasons:

  • A false positive due to the generation of single-step for-loops and the switch statement over a (conceptually) strict enumeration; see this SO question.
  • C enumerations are seen by a compiler as ordinary integers -- see another SO question of mine.
@hirrolot hirrolot added the bug Something isn't working label Apr 9, 2021
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

1 participant