9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] why does this compile?
@ 2013-02-14 21:15 erik quanstrom
  2013-02-14 21:22 ` Charles Forsyth
  0 siblings, 1 reply; 5+ messages in thread
From: erik quanstrom @ 2013-02-14 21:15 UTC (permalink / raw)
  To: 9fans

this is rejected by most other compilers because
rlogn is not initialized to a constant.  the value
returned is bizarre.

- erik

> #include <u.h>
> #include <libc.h>
>
> static char  rlog[24];
> static char *rloge = rlog + sizeof rlog;
> static char *rlogl = rlog + sizeof rlog - 1;
> static char *rlogn = rloge - 1;
>
> void
> main(int, char **)
> {
> 	print("%p %p %p %p\n", rlog, rlogl, rlogn, rloge);
> 	exits(nil);
> }



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

end of thread, other threads:[~2013-02-14 21:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-14 21:15 [9fans] why does this compile? erik quanstrom
2013-02-14 21:22 ` Charles Forsyth
2013-02-14 21:26   ` erik quanstrom
2013-02-14 21:48     ` Charles Forsyth
2013-02-14 21:52       ` erik quanstrom

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