From mint-bounce@lists.fishpool.fi  Tue Jan 22 17:31:17 2008
X-Original-To: fnaumann@mail.boerde.de
Delivered-To: fnaumann@mail.boerde.de
From: "Roger Burrows" <anodyne@cyberus.ca>
Organization: Anodyne Software
To: dogbird@earthlink.net
Date: Mon, 24 Dec 2007 19:37:24 -0500
MIME-Version: 1.0
Subject: Re: [MiNT] Stack problems with GCC 4
Cc: mint <mint@fishpool.com>
Message-ID: <47700A74.30938.1E33059@anodyne.cyberus.ca>
Priority: normal
In-reply-to: <477028EF.6020205@earthlink.net>
References: <1198456590.9451.17.camel@localhost>, <je1w9b3npd.fsf@sykes.suse.de>, <477028EF.6020205@earthlink.net>
X-mailer: Pegasus Mail for Windows (4.41)
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body
X-Authenticated: anodyne@magma.ca - ([192.168.0.21]) [142.46.8.6]
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-To: mint-bounce@lists.fishpool.fi
X-original-sender: anodyne@cyberus.ca
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
List-subscribe: <mailto:mint-request@lists.fishpool.fi?Subject=subscribe>
List-owner: <mailto:tjhukkan@fishpool.fi>
List-post: <mailto:mint@lists.fishpool.fi>
X-Virus-Scanned: by amavisd-new at relay.boerde.de
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de
X-Spam-Status: No, hits=1.2 tagged_above=-50.5 required=7.0 tests=AWL,
 BAYES_00, RCVD_IN_BL_SPAMCOP_NET
X-Spam-Level: *
Status: 
X-Status: 
X-Keywords:                   

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


