You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Sander Temme <sc...@covalent.net> on 2003/07/03 19:02:22 UTC

Re: cvs commit: httpd-2.0/support ab.c

on 7/3/03 9:07, nd@apache.org at nd@apache.org wrote:

> -    char *buff = (char *) malloc(postlen + reqlen + 1);
> +    char *buff = malloc(postlen + reqlen + 1);

Whyfor did you get rid of the cast? This may give you compiler warnings on
some platforms.

S.

-- 
Covalent Technologies                             sctemme@covalent.net
Engineering group                                Voice: (415) 856 4214
303 Second Street #375 South                       Fax: (415) 856 4210
San Francisco CA 94107

   PGP Fingerprint: 7A8D B189 E871 80CB 9521  9320 C11E 7B47 964F 31D9

=======================================================
This email message is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited.  If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message
=======================================================


Re: cvs commit: httpd-2.0/support ab.c

Posted by André Malo <nd...@perlig.de>.
* Sander Striker wrote:

>> From: Sander Temme [mailto:sctemme@covalent.net]
>> Sent: Thursday, July 03, 2003 7:02 PM
> 
>> on 7/3/03 9:07, nd@apache.org at nd@apache.org wrote:
>>
>>> -    char *buff = (char *) malloc(postlen + reqlen + 1);
>>> +    char *buff = malloc(postlen + reqlen + 1);
>>
>> Whyfor did you get rid of the cast? This may give you compiler warnings on
>> some platforms.
> 
> Only with broken compilers.  You don't need to cast from void * with C.

And further a cast may *hide* a useful warning (if malloc isn't
prototyped).

nd

RE: cvs commit: httpd-2.0/support ab.c

Posted by Sander Striker <st...@apache.org>.
> From: Sander Temme [mailto:sctemme@covalent.net]
> Sent: Thursday, July 03, 2003 7:02 PM

> on 7/3/03 9:07, nd@apache.org at nd@apache.org wrote:
> 
>> -    char *buff = (char *) malloc(postlen + reqlen + 1);
>> +    char *buff = malloc(postlen + reqlen + 1);
> 
> Whyfor did you get rid of the cast? This may give you compiler warnings on
> some platforms.

Only with broken compilers.  You don't need to cast from void * with C.


Sander