[net.lang.c] help

elric@proper.UUCP (elric) (08/25/85)

 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 line of code is:
	        lower = 0;  /* lower limit of temperature */

 Could someone tell me what I'm doing wrong?
    Thanx
     Elric of Imrryr

gwyn@brl-tgr.ARPA (Doug Gwyn <gwyn>) (08/26/85)

>  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 line of code is:
> 	        lower = 0;  /* lower limit of temperature */
> 
>  Could someone tell me what I'm doing wrong?

No, because you didn't supply enough information.
The program in the book is okay, so the error must be
in your code.  Check the line or two above where the
compiler detects the problem.  Especially check for
extra/missing { } /* */ ;

wcs@ho95e.UUCP (x0705) (08/26/85)

> >  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 line of code is:
> > 	        lower = 0;  /* lower limit of temperature */
> > 
> >  Could someone tell me what I'm doing wrong?
> 
> No, because you didn't supply enough information.
> The program in the book is okay, so the error must be
> in your code.  Check the line or two above where the
> compiler detects the problem.  Especially check for
> extra/missing { } /* */ ;

The error message you got is normally caused by using constructs that resemble
some of the "old-fashioned" language constructs.  For example:
	foo=-40;
used to mean foo -= 40, instead of foo = (-40).  Several generations of
compilers since then have code to reject "old-fashioned" constructs, even
though they're otherwise perfectly legal.

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.  (Since you can't mix decl.'s and executables, the compiler  may be trying
to get out of a bad situation, and guessing wrong about the error.  Also, as
Doug suggests, watch for extra/missing delimiters.
-- 
## Bill Stewart, AT&T Bell Labs, Holmdel NJ 1-201-949-0705 ihnp4!ho95c!wcs

chris@umcp-cs.UUCP (Chris Torek) (08/28/85)

> > > 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@umcp-cs		ARPA:	chris@maryland

debe@mit-vax.UUCP (Stephen Humble) (08/28/85)

Sender:

[DO THE RIGHT THING]

>	"temp.c", line 8: warning: old-fashioned initialization: use =

This has happened to me too, and it's usually because I put a hyphen
in the function's name, so cc thinks I want to subtract one part of
the name from the other part, or something equally absurd. Hyphens in
declarators are a no_no. :-)
cc is notorious for not telling you that an error has occurred until
several lines after the actual error.

steiny@scc.UUCP (Don Steiny) (09/10/85)

> 
> >	"temp.c", line 8: warning: old-fashioned initialization: use =
> 
	Old UNIX compilers had:

	int i 0;

	mean the same as 

	int i = 0;

	does today.  Many C compilers allow the first form and
issue a warning.

-- 
scc!steiny
Don Steiny @ Don Steiny Software 
109 Torrey Pine Terrace
Santa Cruz, Calif. 95060
(408) 425-0382
	(also: hplabs!hpda!hpdsqb!steiny)

DPHARP01%ULKYVX.BITNET@wiscvm.ARPA (02/21/86)

I am looking for an implementation of either the DES or RSA
encryption algorithims written in C.  Any flavor of C will do, although
VAX C would be nice if I had a choice.  Any help on where I might
look, etc. would be greatly appreciated.

David Harpe
University of Louisville

BITNET: DPHARP01@ULKYVX
Phone:  (502) 588-6303

ZRZS%DS0RUS1I.BITNET@WISCVM.ARPA (Andreas Stumpf) (07/29/86)

Help

nixpbe@seismo.CSS.GOV (09/11/86)

please send more details on your subjects and
describe the way how to get information about
your activities.

J. Loschner