From: "A. Mc." <47dragonfyre@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: Compiler message -Wunused confusion
Date: Wed, 14 Feb 2024 03:11:58 -0800 [thread overview]
Message-ID: <CAOsti3=gO6mD2tFp4eqQ_K_tVSQrQ_AUvAOdV-KAG5jgjWD86A@mail.gmail.com> (raw)
[-- 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!
next reply other threads:[~2024-02-14 11:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 11:11 A. Mc. [this message]
2024-02-14 12:41 ` Segher Boessenkool
2024-02-15 15:31 ` Jędrzej Dudkiewicz
2024-02-14 12:44 ` David Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOsti3=gO6mD2tFp4eqQ_K_tVSQrQ_AUvAOdV-KAG5jgjWD86A@mail.gmail.com' \
--to=47dragonfyre@gmail.com \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).