Help diagnosing a GCC 10.2 problem : error: 'removed_return.213' may be used uninitialized in this function

Nick Savoiu savoiu@yahoo.com
Tue Jan 5 21:31:14 GMT 2021


Hi all, I'm trying to upgrade a codebase from GCC 9.1 to GCC 10.2 and running into weird warning/error messages in the optimized build (-O2).

  error: 'removed_return.213' may be used uninitialized in this function [-Werror=maybe-uninitialized]

I thought that I can just downgrade the -Werror and go on but the code actually crashes on that statement.

The problem code seems to be around a macro that looks like this:

extern bool IsDebugOn();
#define debug IsDebugOn() && std::cout

and that's used like this:

  debug << "print something" << std::endl;

The error goes away if I use

   if (IsDebugOn())
     debug << "print something" << endl;

so I guess the shortcircuited && somehow makes a difference. Unfortunately this happens way deep in the code and any attempts so far to extract the code such that it still exhibits the problem have failed.

I'd appreciate any pointers.

Regards,
Nick


More information about the Gcc-help mailing list