www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/05/10/10:29:05

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Date: Mon, 10 May 1999 10:28:02 -0400
Message-Id: <199905101428.KAA00713@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: Michael_K_Collison AT iassoc DOT ultranet DOT com
CC: cygwin AT sourceware DOT cygnus DOT com
In-reply-to: <8525676D.00183628.00@osiris.iassoc.ultranet.com>
(Michael_K_Collison AT iassoc DOT ultranet DOT com)
Subject: Re: Problem with 'stdin'
References: <8525676D DOT 00183628 DOT 00 AT osiris DOT iassoc DOT ultranet DOT com>

> FILE *p = stdin.
> 
> I'm getting an error from gcc that says: 'initializer element is not a
> constant. I thought this was legal C code. Am I missing something?

It's not legal C code.  stdin doesn't have to be a constant - it can
be a function or a pointer dereference.  In fact, in cygwin it's
defined to be (_impure_ptr->_stdin) - an expression which can't be
computed at compile time.

You'll have to initialize p in main() or something like that.

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019