9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* Re: [9fans] nil, and the danger of zero
  2014-04-04  5:48   ` erik quanstrom
@ 2014-04-04  5:08     ` lucio
  0 siblings, 0 replies; 4+ messages in thread
From: lucio @ 2014-04-04  5:08 UTC (permalink / raw)
  To: 9fans

> which is why this code has
> been just like that in plan 9 for 15 or more years.

Please arrange to change it :-)

++L





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

* [9fans] nil, and the danger of zero
@ 2014-04-04  5:35 erik quanstrom
  2014-04-04  5:40 ` Nick Owens
  0 siblings, 1 reply; 4+ messages in thread
From: erik quanstrom @ 2014-04-04  5:35 UTC (permalink / raw)
  To: 9fans

so, as it turns out, not all zeros do the same thing to the stack.....  pfffft.
at least it's a simple reason why venti won't run.

; diffy -c ../boot/local.c
/n/dump/2014/0403/sys/src/nix/boot/local.c:212,218 - ../boot/local.c:212,218
  				f[2] = "tcp!127.1!8000";
  			}
  			configloopback();
- 			run("/boot/venti", "-c", f[0], "-a", f[1], "-h", f[2], 0);
+ 			run("/boot/venti", "-c", f[0], "-a", f[1], "-h", f[2], nil);
  			/*
  			 * If the announce address is tcp!*!foo, then set
  			 * $venti to tcp!127.1!foo instead, which is actually dialable.
/n/dump/2014/0403/sys/src/nix/boot/local.c:233,239 - ../boot/local.c:233,239

  	/* start fossil */
  	print("fossil(%s)...", partition);
- 	run("/boot/fossil", "-f", partition, "-c", "srv -A fboot", "-c", "srv -p fscons", 0);
+ 	run("/boot/fossil", "-f", partition, "-c", "srv -A fboot", "-c", "srv -p fscons", nil);
  	fd = open("#s/fboot", ORDWR);
  	if(fd < 0){
  		print("open #s/fboot: %r\n");

- erik



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

* Re: [9fans] nil, and the danger of zero
  2014-04-04  5:35 [9fans] nil, and the danger of zero erik quanstrom
@ 2014-04-04  5:40 ` Nick Owens
  2014-04-04  5:48   ` erik quanstrom
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Owens @ 2014-04-04  5:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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

On Fri, Apr 04, 2014 at 01:35:05AM -0400, erik quanstrom wrote:
> so, as it turns out, not all zeros do the same thing to the stack.....  pfffft.
> at least it's a simple reason why venti won't run.
> 

(void *)0 is certainly not the same as 0.
depending on architecture and compiler, of course.


[-- Attachment #2: Type: application/pgp-signature, Size: 851 bytes --]

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

* Re: [9fans] nil, and the danger of zero
  2014-04-04  5:40 ` Nick Owens
@ 2014-04-04  5:48   ` erik quanstrom
  2014-04-04  5:08     ` lucio
  0 siblings, 1 reply; 4+ messages in thread
From: erik quanstrom @ 2014-04-04  5:48 UTC (permalink / raw)
  To: 9fans

> (void *)0 is certainly not the same as 0.
> depending on architecture and compiler, of course.

it's not the compiler, it's the type model, which if anything
is tied to the hardware.  you just won't have this sort of
problem on a 32-bit machine.  which is why this code has
been just like that in plan 9 for 15 or more years.

- erik



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

end of thread, other threads:[~2014-04-04  5:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-04  5:35 [9fans] nil, and the danger of zero erik quanstrom
2014-04-04  5:40 ` Nick Owens
2014-04-04  5:48   ` erik quanstrom
2014-04-04  5:08     ` lucio

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