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

Re: [MiNT] Stack problems with GCC 4



Andreas Schwab wrote:
josephus <dogbird@earthlink.net> writes:

I have a question.  I have gcc 3.3 on linux and if I declare   a file
pointer then initialize it

 (FILE *)  ptr = (FILE *) malloc(....

i get lvalue assignments are deprecated.

I doubt that this is the message you get.  Assigning to an lvalue is
surely not deprecated.  But a cast expression is not an lvalue.
Moreover, a FILE is an opaque structure that cannot be allocated with
malloc, only the C library is able to do that.  Whatever you are trying
to do here, it will not work.

Andreas.

I am trying to malloc a pointer to a file. that should not be illegal but the messages are confusing. if I just stick the malloc in the pointer I get OTHER ERRORS.


when I use that  ptr  I get   this

  (FILE *) prt =  fopen(....)

  lvalue casts are deprecated.
if i delete the (FILE *) i get pointer conversion to int without a cast,

  here I am trying to open a file.

are you sure this error condition is not a bug. I cant find any configuration to remove the warnings.

josephus

--
I go sailing in the Summer and look at STARS in the Winter.
"Everybody is igernant, only on differt subjects"
Will Rogers "it aint what you know that gets you in trouble
it is what you know that aint so"
   Josh Billings.