This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Removing casts from code
- From: Roland McGrath <roland at redhat dot com>
- To: Ulrich Drepper <drepper at redhat dot com>
- Cc: Art Haas <ahaas at airmail dot net>, libc-alpha at sources dot redhat dot com
- Date: Mon, 6 Jan 2003 19:01:52 -0800
- Subject: Re: Removing casts from code
> These changes are completely out of question. I want to have return
> values of allocation functions casted to the correct type. Some code
> you might want some day use with a C++ compiler and it also happened
> several times that I changed malloc to alloca() in which can the cast is
> sometimes needed.
The code is C (post-1989 C), not C++. If someday one actually uses some
code as C++ source, then it will be worthwhile to add the casts as needed.
alloca returns void * as well and I have never heard of any reason a cast
would be needed. There is no reason to bother removing casts from existing
code, but there is no reason to add them to new code either.