[gnu.gcc] Gcc needs -traditional for unexpected reason

kevin@kosman.UUCP (Kevin O'Gorman) (09/06/89)

I tracked down the reason why I could not restore saved games in my
copy of Nethack 3.0 to a problem with an implied initialization in decl.c.
The problem does not occur if the -traditional switch is used, although
this is not one of the documented effects of that switch, and I don't
know enough about the ANSI standard to know if it is reasonable.

The offending line is:
const char nul[40] = DUMMY;		/* contains zeros */

Where DUMMY is #defined to be {0};

In my version, gcc 1.35, all I get is two bytes of zero, where I would
expect 40.  With the -traditional switch, I haven't checked exactly what
I get, but it must be more because save and restore now work.

For the gcc people, please check if the behavior is reasonable, and if so
include it in the description of the -traditional switch.  If not, fix it
(sorry, I cannot understand your compiler well enough to help with that).

For the HACK 3.0 people, you could give better advice than what I found
(and relied on) here in the Makefile:

# if you are using gcc as your compiler:
#	add -fwritable-strings to your other CFLAGS
#	uncomment the CC definition below if it's not in your environment
#	ignore warnings about initializing non-const *s from const *s
#	if you get setcgtty() warnings during execution, you are feeding gcc
#		a non-ANSI <sys/ioctl.h> -- either run fixincludes on it or use
#		-traditional in CFLAGS

rms@AI.MIT.EDU (09/07/89)

PLEASE DON'T REPORT BUGS IN GCC TO INFO-GCC.
Any posting about behavior you consider anomalous or possibly erroneous
is a bug report, and should be sent to bug-gcc@prep.ai.mit.edu.
NOT to info-gcc.  And NOT the newsgroup gnu.gcc, which is equivalent
to info-gcc.

And include in each bug report a complete, self-contained test case
with full directions for reproducing the problem.  I don't have a copy
of nethack, and you shouldn't expect me to find one.  It would be
inefficient for me to look for one--I would fix fewer bugs that day,
which is bad for everyone--so don't ask me to.  Send a test case
in the FIRST report.

I'll investigate this bug as soon as I receive a bug report suitable
for immediate action.