This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem with 'stdin'



> 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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]