Help

Chris Torek chris at umcp-cs.UUCP
Thu Aug 29 01:16:49 AEST 1985


> > > When ever I attempt to compile the Fahrenheit-Celsius table
> > > program (on pg 8 of _The C Programming Language_) I get this error:
> > >	"temp.c", line 8: warning: old-fashioned initialization: use =

> The error message you got is normally caused by using constructs
> that resemble some of the "old-fashioned" language constructs.

Right so far...

> For example:
>	foo=-40;
> used to mean foo -= 40, instead of foo = (-40).

This is true, but not directly related to the actual error given above.

> I this case, I'd check to make sure "lower" has been declared, as
> a scalar (int or double?), and that you don't have any more variable
> declarations after it.

The problem is one of two things.  The Portable C Compiler has seen
either

	<type> <variable> <constant>

or

	<type> <variable> {

when it gives the "warning: old-fashioned initialization: use ="
error message.  (The next message may well be "syntax error".)
One of the rather neat things you can do is run "cc -E" on the
source file, to see what's actually being compiled.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at maryland



More information about the Comp.lang.c mailing list