delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/07/22:10:15

Message-ID: <393EFFB8.2D5AA7BB@fujixerox.co.jp>
Date: Thu, 08 Jun 2000 11:06:48 +0900
From: Burgupalli Chaitanya <Chaitanya DOT Burgupalli AT fujixerox DOT co DOT jp>
Organization: Wipro Technologies
X-Mailer: Mozilla 4.73 [en] (Win98; I)
X-Accept-Language: en,ja
MIME-Version: 1.0
To: DJGPP <djgpp AT delorie DOT com>
Subject: malloc question - About output casting
Reply-To: djgpp AT delorie DOT com

Hello,
I have been casting the malloc to the required pointer type.
But there was a mailing list thread where in it was recomended that 
it is better not do that. 
I have tried doing that but the compiler gives warnings at the
particular
line. May be i am not doing it exactly right. 
Here is the code line and the warning it got from the compiler

	strSrc = malloc(100); /* char *strSrc  */ 
	main.c:34: warning: assignment makes pointer from integer without a
cast

I am using djgpp with the version of gcc being 2.952, if this makes any 
difference.

Is there something wrong with the way i am doing it?

Chaitanya B

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019