[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [MiNT] Stack problems with GCC 4
Hi!
On 24 Dec 2007 at 15:47, josephus wrote:
> >
> 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.
>
I think you can be sure that this particular error message is there to tell you
that you are doing something wrong. The difficulty of course is always
figuring out exactly what ...
I'm not sure what exactly you are trying to do. Normally you declare a file
handle as a static or dynamic variable in your code, e.g.
FILE *input;
then you open the file with:
input = fopen(....);
and afterwards you fread/fwrite etc to 'input'.
You *could* do the following as well:
FILE **inputptr;
inputptr = (FILE **) malloc(sizeof(FILE *));
*inputptr = fopen(...);
and afterwards you fread/fwrite to '*inputptr' ... but this is pointlessly
confusing IMHO.
Roger Burrows