9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] 8c funny
@ 2005-05-26 18:44 Ben Huntsman
  2005-05-26 18:55 ` jmk
  0 siblings, 1 reply; 8+ messages in thread
From: Ben Huntsman @ 2005-05-26 18:44 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

>it works on alpha and amd64...

Really stupid question-
  we have an amd64 compiler??


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

* Re: [9fans] 8c funny
  2005-05-26 18:44 [9fans] 8c funny Ben Huntsman
@ 2005-05-26 18:55 ` jmk
  0 siblings, 0 replies; 8+ messages in thread
From: jmk @ 2005-05-26 18:55 UTC (permalink / raw)
  To: 9fans

We're still shaking the bugs out.

On Thu May 26 14:45:10 EDT 2005, BHuntsman@mail2.cu-portland.edu wrote:
> >it works on alpha and amd64...
> 
> Really stupid question-
>   we have an amd64 compiler??


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

* Re: [9fans] 8c funny
  2005-05-26 17:18 ` Bruce Ellis
@ 2005-05-26 18:23   ` Charles Forsyth
  0 siblings, 0 replies; 8+ messages in thread
From: Charles Forsyth @ 2005-05-26 18:23 UTC (permalink / raw)
  To: 9fans

% 7c -wFV busted.c
warning: busted.c:5 used and not set: a b

it works on alpha and amd64, because in some ways
the set/used is a side-effect of working out when to
put things in registers (or not), and with 64-bit registers,
typev[et] is explicitly allowed (ie, no funny punning), and
ça marche.



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

* Re: [9fans] 8c funny
  2005-05-26 17:10 Brantley Coile
  2005-05-26 17:16 ` Russ Cox
@ 2005-05-26 17:18 ` Bruce Ellis
  2005-05-26 18:23   ` Charles Forsyth
  1 sibling, 1 reply; 8+ messages in thread
From: Bruce Ellis @ 2005-05-26 17:18 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

more confusion.  vlongs aren't tracked for these warnings,
just as structs/unions aren't.  internally they are treated
much like composites (e.g. they end up at sugen()).
perhaps this should be fixed - it's not too hard.
still confused?  well i need some more coffee.

brucee

On 5/27/05, Brantley Coile <brantley@coraid.com> wrote:
> term% 8c -FVw busted.c
> warning: busted.c:5 used and not set: b
> term% cat busted.c
> #include <u.h>
> #include <libc.h>
> 
> void
> main(void)
> {
>        vlong a;
> 
>        int b;
> 
>        if (a == 0)
>                exits(nil);
>        if (b == 0)
>                exits(nil);
>        exits(nil);
> }
>


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

* Re: [9fans] 8c funny
  2005-05-26 17:10 Brantley Coile
@ 2005-05-26 17:16 ` Russ Cox
  2005-05-26 17:18 ` Bruce Ellis
  1 sibling, 0 replies; 8+ messages in thread
From: Russ Cox @ 2005-05-26 17:16 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

the real problem is that the compiler doesn't
do used and not set on vlongs, because they
were originally treated a lot more like structures
than scalars.

russ


On 5/26/05, Brantley Coile <brantley@coraid.com> wrote:
> term% 8c -FVw busted.c
> warning: busted.c:5 used and not set: b
> term% cat busted.c
> #include <u.h>
> #include <libc.h>
> 
> void
> main(void)
> {
>         vlong a;
> 
>         int b;
> 
>         if (a == 0)
>                 exits(nil);
>         if (b == 0)
>                 exits(nil);
>         exits(nil);
> }
>


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

* Re: [9fans] 8c funny
@ 2005-05-26 17:10 Brantley Coile
  2005-05-26 17:16 ` Russ Cox
  2005-05-26 17:18 ` Bruce Ellis
  0 siblings, 2 replies; 8+ messages in thread
From: Brantley Coile @ 2005-05-26 17:10 UTC (permalink / raw)
  To: 9fans

term% 8c -FVw busted.c
warning: busted.c:5 used and not set: b
term% cat busted.c
#include <u.h>
#include <libc.h>

void
main(void)
{
	vlong a;

	int b;

	if (a == 0)
		exits(nil);
	if (b == 0)
		exits(nil);
	exits(nil);
}


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

* Re: [9fans] 8c funny
  2005-05-26 16:52 Brantley Coile
@ 2005-05-26 17:02 ` Bruce Ellis
  0 siblings, 0 replies; 8+ messages in thread
From: Bruce Ellis @ 2005-05-26 17:02 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

yes, it's "only one prize per child".  if cc finds an error (or warning)
in an expression it generally bails on that item - avoiding the
"cascade of errors" from a simple typo.  sometimes it can be
annoying (fix "b" in this case and next compile it will complain
about "a") but usually it saves investigating non-errors.

brucee

On 5/27/05, Brantley Coile <brantley@coraid.com> wrote:
> Any one seen this before?
> 
> term% cat busted.c
> #include <u.h>
> #include <libc.h>
> 
> void
> main(void)
> {
>        vlong a;
>        int b;
> 
>        if (a == b)
>                exits(nil);
>        exits(nil);
> }
> term% 8c -FVw busted.c
> warning: busted.c:5 used and not set: b
> term%
> 
> Note that a doesn't get tagged as used and not set.
> 
> 
>  Brantley


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

* [9fans] 8c funny
@ 2005-05-26 16:52 Brantley Coile
  2005-05-26 17:02 ` Bruce Ellis
  0 siblings, 1 reply; 8+ messages in thread
From: Brantley Coile @ 2005-05-26 16:52 UTC (permalink / raw)
  To: 9fans

Any one seen this before?

term% cat busted.c
#include <u.h>
#include <libc.h>

void
main(void)
{
	vlong a;
	int b;

	if (a == b)
		exits(nil);
	exits(nil);
}
term% 8c -FVw busted.c
warning: busted.c:5 used and not set: b
term% 

Note that a doesn't get tagged as used and not set.


 Brantley


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

end of thread, other threads:[~2005-05-26 18:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-26 18:44 [9fans] 8c funny Ben Huntsman
2005-05-26 18:55 ` jmk
  -- strict thread matches above, loose matches on Subject: below --
2005-05-26 17:10 Brantley Coile
2005-05-26 17:16 ` Russ Cox
2005-05-26 17:18 ` Bruce Ellis
2005-05-26 18:23   ` Charles Forsyth
2005-05-26 16:52 Brantley Coile
2005-05-26 17:02 ` Bruce Ellis

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).