🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52560

Re: include's for gcc 2.2.1 and NeXT-cc 1.36 on one NeXT machine?

#52560
From: Marc Ullman
Date: Fri, 03 Jul 1992 02:08
34 lines
1680 bytes
>I believed I have successfully installed gcc  2.2.1 and libg++,  all into
>the default local locations. Unfortunately, I now get strange errors:
>
>#include <stdio.h>
>double describe(double *p, FILE *f) {
>  fprintf(f, "Say: %lf", p[ 1 ]);
>  return p[1];
>}}
>$ cc -Wall -c try.c
>try.c: In function `describe':
>try.c:4: warning: use of `l' length character with `f' type character
>
>I believe this  is because the new  gcc  tries  to use some  of  the old
>include files. I figured this out by using the -E option.

This has *nothing* to do with include files.  In ANSI-C you can't use
"l" and "f" in the same format specification.  For example, refer to
page 111 of Plauger and Brodie, "Standard C", a *must-have* quick ref.
You should change your example to:

double describe(double *p, FILE *f) {
  fprintf(f, "Say: %f", p[ 1 ]);
  return p[1];
}

or

double describe(long double *p, FILE *f) {
  fprintf(f, "Say: %Lf", p[ 1 ]);	/* Note use of CAPITAL "L" */
  return p[1];
}

--Marc Ullman
  Stanford University
Technical Details
Message-ID: <9207030308.AA07702@sun-valley.Stanford.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!sun-valley.stanford.edu!marc
References: <1992Jul2.111143.29768@mic.ucla.edu>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,d08716320d884291
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-07-03 17:12:30 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!sun-valley.stanford.edu!marc
From: marc@sun-valley.stanford.edu (Marc Ullman)
Subject: Re: include's for gcc 2.2.1 and NeXT-cc 1.36 on one NeXT machine?
Message-ID: <9207030308.AA07702@sun-valley.Stanford.EDU>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
References: <1992Jul2.111143.29768@mic.ucla.edu>
Distribution: gnu
Date: Fri, 3 Jul 1992 02:08:56 GMT
Lines: 35