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

disable -Werror when building in release #165

Closed
Waffl3x opened this issue Mar 13, 2023 · 1 comment
Closed

disable -Werror when building in release #165

Waffl3x opened this issue Mar 13, 2023 · 1 comment

Comments

@Waffl3x
Copy link

Waffl3x commented Mar 13, 2023

I got the warning possibly dangling reference to a temporary warning in GCC13 in the following places

https://github.com/foonathan/cppast/blob/main/src/code_generator.cpp#L554
https://github.com/foonathan/cppast/blob/main/src/cpp_entity.cpp#L16

I spent a lot of time looking over the code and I eventually came to the conclusion that there doesn't seem to be any bugs in the code, it's just a bug in GCC13. I'm pretty confident there are no actual problems, it's just some sort of false positive because of an lvalue reference resulting from a member function called on a prvalue. Normally this is bad, with the optional reference type you use it isn't a problem.

To avoid problems like this in the future, I believe -Werror should be disabled when being built as part of a subdirectory. I'm not much of a cmake expert so I don't know how achievable this would be but I believe it would be beneficial.

@foonathan
Copy link
Collaborator

Good idea, I've implemented that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants