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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux