From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] bug in authdial()
Date: Sat, 21 May 2016 15:34:34 -0700 [thread overview]
Message-ID: <12a922fd11c38ba198a09eb541dd2219@lilly.quanstro.net> (raw)
In-Reply-To: <59f9566e7a6de1f71dd1e928ac8e2e0f@9netics.com>
On Sat May 21 15:19:06 PDT 2016, 9nut@9netics.com wrote:
> > < char exitsts[2*ERRMAX];
> > ---
> >> Waitmsg *exitsts = nil;
> >
> > is likely to generate used-and-not-set on amd64.
> >
> > - erik
>
> i'm not sure i understand how. can you explain?
since the only code path that uses exitsts sets it unconditionally,
setting a declaration time is going to be optimized out. when the
optimizer elides setting of a variable it emits the set and not used
diagnostic.
gcc doesn't do this with the usual flags, which is why it may be unexpected.
i've included a test program that makes this a little easier to read.
the test program emits the diagnostic "warning: warn.c:9 set and not used: s"
- erik
---
#include <u.h>
#include <libc.h>
void
main(void)
{
char *s;
s = nil;
s = "xyz";
print("s=%s\n", s);
exits("");
}
next prev parent reply other threads:[~2016-05-21 22:34 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-18 0:43 arisawa
2016-05-18 9:14 ` cinap_lenrek
2016-05-19 14:45 ` arisawa
2016-05-19 15:43 ` lucio
2016-05-19 15:48 ` Charles Forsyth
2016-05-20 4:58 ` arisawa
2016-05-20 22:04 ` Skip Tavakkolian
2016-05-20 22:25 ` Charles Forsyth
2016-05-21 4:46 ` arisawa
2016-05-21 17:04 ` erik quanstrom
2016-05-21 23:11 ` Lyndon Nerenberg
2016-05-21 23:16 ` erik quanstrom
2016-05-21 17:06 ` erik quanstrom
2016-05-21 3:24 ` arisawa
2016-05-23 14:27 ` arisawa
2016-05-20 22:07 ` Skip Tavakkolian
2016-05-21 2:25 ` Skip Tavakkolian
2016-05-21 7:00 ` arisawa
2016-05-21 16:51 ` erik quanstrom
2016-05-21 21:45 ` Skip Tavakkolian
2016-05-21 21:48 ` erik quanstrom
2016-05-21 22:16 ` Skip Tavakkolian
2016-05-21 21:50 ` erik quanstrom
2016-05-21 22:17 ` Skip Tavakkolian
2016-05-21 22:34 ` erik quanstrom [this message]
2016-05-21 23:03 ` Skip Tavakkolian
2016-05-21 23:31 ` erik quanstrom
2016-05-21 22:53 ` David du Colombier
2016-05-18 13:06 ` Charles Forsyth
2016-05-18 17:03 ` Skip Tavakkolian
2016-05-19 4:07 ` arisawa
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=12a922fd11c38ba198a09eb541dd2219@lilly.quanstro.net \
--to=quanstro@quanstro.net \
--cc=9fans@9fans.net \
/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).