[comp.sys.encore] nn patch level 13 on an encore multimax system

mejh@ux.acs.umn.edu (Michael E. Hedman) (03/13/91)

I am not really sure to complain to on this matter, but I have submitted
this to "news.software.nn" and "comp.sys.encore".

We have an Encore Multimax system running UMAX 4.3, a bsd 4.3 system.
When compiling "nn", there are some unusual error messages from the
programs "answer.c" and  "save.c". These programs reference a variable
called "st_flag". The stock "c" compiler on the encore gives the following 
error messages:

	/usr/bin/cc -Iconf  -O -q optimize=time -c answer.c
"answer.c", line 464: warning: old-fashioned initialization
"answer.c", line 464: Illegal variable or expression
"answer.c", line 464: Type mismatch
"answer.c", line 464: Type mismatch
"answer.c", line 464: expected: ';' got: name
"answer.c", line 540: warning: illegal member use:  stu_flagu
"answer.c", line 586: warning: illegal member use:  stu_flagu
"answer.c", line 726: warning: illegal member use:  stu_flagu

The "gcc" c compiler gives similar error messages. You will notice that the 
error messages refer to something called "stu_flagu". This variable does not
exist. Looked like "st_flag" was being warped into something bad. Investigation
of encore's include files yielded the following macro definition in 
"/usr/include/sys/stat.h":

#define	st_flag		st_un.stu_flagu.stu_flag

For now, renaming the variable works.

soper@encore.UUCP (Pete Soper,Cary NC,9194813730,9193624635) (03/13/91)

From article <3598@ux.acs.umn.edu>, by mejh@ux.acs.umn.edu (Michael E. Hedman):
> I am not really sure to complain to on this matter, but I have submitted
> this to "news.software.nn" and "comp.sys.encore".
> 
> We have an Encore Multimax system running UMAX 4.3, a bsd 4.3 system.
> When compiling "nn", there are some unusual error messages from the
> programs "answer.c" and  "save.c". These programs reference a variable
> called "st_flag". The stock "c" compiler on the encore gives the following 
> error messages:
> 
> 	/usr/bin/cc -Iconf  -O -q optimize=time -c answer.c
> "answer.c", line 464: warning: old-fashioned initialization
> "answer.c", line 464: Illegal variable or expression
  (etc)

  The fact that GNU C and Encore C give similar complaints is encouraging :-)
  If I were going to diagnose this, I'd use "-E" instead of "-c" and direct
standard output to a file. Then by examining the line of this file that
corresponds to line 464 of the source file the real error would become
apparent. From your description it sounds like your local variable st_flag
has collided with a #define name. Is line 464 something like:

 int st_flag;

 If so, what the compiler sees (and what you would see from the -E output) is:

 int st_un.stu_flagu.stu_flag;

 And this is incorrect syntax.
-----------------------------------------------------------------------
Pete Soper (soper@encore.com)                           +1 919 481 3730
Encore Computer Corp, 901 Kildaire Farm Rd, bldg D, Cary, NC 27511  USA