Re: Compiler message -Wunused confusion

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

 



On 14/02/2024 12:11, A. Mc. via Gcc-help wrote:
Hello,

I am receiving the gcc compiler warning -Wunused-value computed not used. I
can confirm this is true in my embedded application, the statement never
switches. But I am completely confused as to why. It's essentially the
following code:

volatile bool foo;

while (true) {
if (foo == true){
        //do something
        foo = false;}
else{
        //do something else
        foo = true;}
}

Which never switches. What could be the cause of this?

Many thanks in advance!


My guess is that you have simplified the code a bit too much here. Something else is wrong. (It is a good idea to pare down the code to the minimum that demonstrates the problem, as you have tried to do here. But I think you have removed to much!)

David





[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