public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Compiler message -Wunused confusion
@ 2024-02-14 11:11 A. Mc.
  2024-02-14 12:41 ` Segher Boessenkool
  2024-02-14 12:44 ` David Brown
  0 siblings, 2 replies; 4+ messages in thread
From: A. Mc. @ 2024-02-14 11:11 UTC (permalink / raw)
  To: gcc-help

[-- Attachment #1: Type: text/plain, Size: 477 bytes --]

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!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-15 15:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-14 11:11 Compiler message -Wunused confusion A. Mc.
2024-02-14 12:41 ` Segher Boessenkool
2024-02-15 15:31   ` Jędrzej Dudkiewicz
2024-02-14 12:44 ` David Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).