[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: [LI] Help compilation problem !!!



Hmm.. Looks like a (mis)understanding problem.

The error means that you *can not* use non-constant expressions for
initializing the global data. Basically, you can not do this (except in case
you rewrite stdlib and make stderr, stdout etc. constants ;-). Period.

-- KD

-----Original Message-----
From: Satish Pagare <asatsi@xxxxxxxxxxx>
To: linux-india@xxxxxxxxxxxxxxxxxxxxx <linux-india@xxxxxxxxxxxxxxxxxxxxx>
Cc: satishp@xxxxxxxxxxxx <satishp@xxxxxxxxxxxx>; kram@xxxxxxxxxxxx
<kram@xxxxxxxxxxxx>
Date: Monday, October 11, 1999 10:12 PM
Subject: [LI] Help compilation problem !!!


>Hi  All,
> I have a strange problem while compiling the following code
>on RH6.0.
>-----begin code
>#include<stdio.h>
>FILE *fp = stderr;
>main()
>{
>}
>-----end code
>
>The above code gives compilation error :
>
>[kram@linux2idc net]$ cc a.c
>a.c:2: initializer element is not constant
>
>but if I change the  code to ....
>
>---begin code
>#include<stdio.h>
>FILE *fp;
>main()
>{
> fp = stderr;
>}
>--- end code
>the compilation goes through !!!!
>Please help to remove the errors. Pls reply to this mail ASAP to
>kram@xxxxxxxxxxxx
>
>
>:--------------------------------------------:
>   Is it AIR that you BREATHE?
>                    Morpheus. (time unknown)
>:--------------------------------------------:
>Satish K. Pagare,
>Visit me : http://www.geocities.com/asatsi
>Software Engineer.
>INFORMIX India Development Center.
>Mumbai - 400 096, INDIA.
>mailto:asatsi@xxxxxxxxxxx
>
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>--------------------------------------------------------------------
>The Linux India Mailing List Archives are now available.  Please search
>the archive at http://lists.linux-india.org/ before posting your question
>to avoid repetition and save bandwidth.
>






--------------------------------------------------------------------
The Linux India Mailing List Archives are now available.  Please search
the archive at http://lists.linux-india.org/ before posting your question
to avoid repetition and save bandwidth.