From: Ori Bernstein <ori@eigenstate.org>
To: 9front@9front.org
Subject: Re: [9front] Ape: Fix assert warnings.
Date: Tue, 18 Jun 2019 09:36:41 -0700 [thread overview]
Message-ID: <20190618093641.2ec61addb29b579338cacbde@eigenstate.org> (raw)
In-Reply-To: <A1F18C6F6CF403D7055BCB03161D95EE@felloff.net>
On Tue, 18 Jun 2019 16:35:07 +0200, cinap_lenrek@felloff.net wrote:
> this is not full fix tho. it still warns for non-constant case...
stdio putc has a similar issue to this, but it *needs* to
return an int, so a void cast isn't quite enough anyways.
I'd thought of making USED() an expression, so we could do:
x = USED(a?b:c)
Thinking about it more, a better solution may be to say that
if one of the ternary branches has side effects, the other is
implicitly USED(), which will solve this warning.
0 ? 0 : 1
should warn, but
1 ? 0 : printf("nope");
should be silent, because printf has a side effect.
next prev parent reply other threads:[~2019-06-18 16:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-18 14:35 cinap_lenrek
2019-06-18 16:36 ` Ori Bernstein [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-06-18 16:46 cinap_lenrek
2019-06-18 20:37 ` Ori Bernstein
2019-06-18 14:37 cinap_lenrek
2019-06-18 14:26 cinap_lenrek
2019-06-18 11:57 cinap_lenrek
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=20190618093641.2ec61addb29b579338cacbde@eigenstate.org \
--to=ori@eigenstate.org \
--cc=9front@9front.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 NNTP newsgroup(s).