erik quanstrom
2013-02-14 21:15:25 UTC
this is rejected by most other compilers because
rlogn is not initialized to a constant. the value
returned is bizarre.
- erik
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);
}
#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);
}