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

NullStream constructor and deconstructor not optimized away with GOOGLE_STRIP_LOG #933

Open
JensHuthmann opened this issue Jun 22, 2023 · 1 comment
Labels

Comments

@JensHuthmann
Copy link

When compiling with gcc 13.1 (and other version) and using GOOGLE_STRIP_LOG the output gets optimized away as expected.
However, the constructor and deconstruction calls of NullStream() are left over in the compiled program.

I copied together from 3a0d4d2 with a cmake -DCMAKE_BUILD_TYPE=Release .. generated output.

Link to compiler explorer See line 518 in compiler output

@JensHuthmann JensHuthmann changed the title NullStream constructor and deconstruction not optimized away with GOOGLE_STRIP_LOG NullStream constructor and deconstructor not optimized away with GOOGLE_STRIP_LOG Jun 22, 2023
@sergiud sergiud added the bug label Dec 21, 2023
@sergiud
Copy link
Collaborator

sergiud commented Dec 21, 2023

Good catch!

After looking into the issue, I believe something like this could work. NullStream should probably not derive from LogMessage::LogStream to allow the compiler to optimize the corresponding symbols away.

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

No branches or pull requests

2 participants