[3535] in Athena Bugs
compiler: vax -vs- nxsaber
daemon@ATHENA.MIT.EDU (garner@ATHENA.MIT.EDU)
Mon Oct 30 17:15:50 1989
From: garner@ATHENA.MIT.EDU
Date: Mon, 30 Oct 89 15:26:10 -0500
To: saber-bugs@ATHENA.MIT.EDU, bugs@ATHENA.MIT.EDU
From: epeisach@ATHENA.MIT.EDU
Date: Fri, 27 Oct 89 14:14:11 -0400
To: bugs@ATHENA.MIT.EDU
Subject: nxsaber diffeence from vax compiler
The following program is interpretded diffently by the vax compiler and
nxsaber. Admittedly, order of operations are not defined below. but on a
vax I get only one string (Wilbur) printed, but in saber, I get a
warning during execution that n is not set. If I change the line, int n,
to int n=0, saber does not complain and prints both strings. It appears
to me that saber should give a warning in that case probably as well...
-Ezra
----------------------------------------------------------------------
#include <strings.h>
#include <stdio.h>
main()
{
int n;
char *buf="Wilbur\n";
if(write(2, buf, n=strlen(buf)) != n) {
printf("Hello there\n");
}
}