• Uncategorized

About linux : Wrong-condition-evaluation-using-gcc

Question Detail

I have a code that depends on many external libraries that works fine in debug mode but it crashes in release mode.
When checking the root cause I found that there is a true condition that’s evaluated to false

My code looks like

#include <iostream>

enum fruits
a, b, c
int main()
   auto condition (fruits::a == 99);
   std::cout << condition;
   if (fruits::a == 99) std::cout << " FATAL ERROR ";

The progam outputs :


The program is using c++20 with O2 optimisation flag

The issue is not present if I execute the code in a separated program.

Question Answer

No answer for now.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.