[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pb compiling with gcc-2.7.2.3-3



On Sat, 10 Jan 1998, Eric Delaunay wrote:

> I've tracked the problem down to the following source I cannot compile:
> -------cut here--------
> #include <stdio.h>
> FILE *out = stdout;
> main()
> {
>   fprintf( out, "hello\n" );
> }
> -------cut here--------

	Should that program work?  You are initializing a local
variable with the contents of an extern one.  It's like this one:
---cut here---
extern int a;
int b = a;
main() {}
---cut here---
	...which doesn't work on sparc, and doesn't work on i386.

	In libc5 and glibc-2.0, std{in,out,err} are defined to... I
don't know what, but they aren't strictly `extern FILE *', as ANSI C
says they should be.

> I'd appreciate any help to determine where is the problem (gcc, libc, anything
> else, ...).

	I think the problem is in that program.  But I may be wrong...
I don't have the ANSI C specs here.

-- 
Juan Cespedes


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-sparc-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: