linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: linuxppc-dev@lists.linuxppc.org
Subject: Re: compile-error: stdin is not a constant
Date: Wed, 3 Nov 1999 11:59:03 -0500	[thread overview]
Message-ID: <19991103115903.A28115@drow.res.cmu.edu> (raw)
In-Reply-To: <382076B7.B14665A2@univ-rennes1.fr>; from Martin Costabel on Wed, Nov 03, 1999 at 05:53:59PM +0000


On Wed, Nov 03, 1999 at 05:53:59PM +0000, Martin Costabel wrote:
> Maybe this will work (1):
> 
> FILE *foo = (FILE *) STDIN_FILENO;


No no no no no!  STDIN_FILENO is a -number-, not a -pointer-!

> In a similar situation, I learned from Tom Rini that the correct way
> would be (2)
> 
> static file *file ;
> static void file_construct (void) __attribute__((constructor));
> static void file_construct (void) { file = stdin; }

Yes, that's it.  gcc specific, but works.  (1) is DEFINITELY wrong.


Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|        SCS Class of 2002       |
|   Debian GNU/Linux Developer    __    Carnegie Mellon University   |
|         dan@debian.org         |  |       dmj+@andrew.cmu.edu      |
\--------------------------------/  \--------------------------------/

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

      reply	other threads:[~1999-11-03 16:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-03 12:25 compile-error: stdin is not a constant Wolfgang Haeuptli
1999-11-03 15:36 ` Daniel Jacobowitz
1999-11-03 17:53   ` Martin Costabel
1999-11-03 16:59     ` Daniel Jacobowitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19991103115903.A28115@drow.res.cmu.edu \
    --to=drow@false.org \
    --cc=linuxppc-dev@lists.linuxppc.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).