Some of the example fixes include:
* casting malloc, realloc(), calloc(), etc. calls to avoid errors
with C++ compilers and warnings with gcc with -Wc++-compat on.
* a few other assorted casting fixes
* removal of some unused variables
* replacing function prototypes with empty parameter lists with
(void). icc complains loudly about this.
* fixing a few declaration after statement errors. Compilers in C90
mode will error out on this.
* math with void pointer fixes. C++ compilers error on this usually.
* const'ing return types for two functions that always return constant char *'s
* assorted other fixes and cleanups
Please let me know if you have any questions or comments.
Thanks!
Steve Peters
st...@fisharerojo.org
Steve Peters
This appears to have been warnocked. Any comments from those with
commit access?
Steve Peters
>> Some of the example fixes include:
>> * casting malloc, realloc(), calloc(), etc. calls to avoid errors
>> with C++ compilers and warnings with gcc with -Wc++-compat on.
Why do we want this? This is a C-project and assigning to/form a void
pointer is perfectly legal without a cast and this unneeded cast just
clutters the code.
Trond
--
Oleg Grenrus
>
> icc is actually c++ compiler but compiles c-code much better then gcc?
If it fails to accept assignment to/from a void pointer it does not
compile c-code better than gcc, because that is a perfectly legal
construct in C. (According to http://www.intel.com/cd/software/products/asmo-na/eng/284736.htm
(page 3) it claims to support C99, so _if_ icc really fails to
compile such constructs I guess that you should file a bug report on
the compiler.
Trond
Steve
I agree with trond actually... we had a patch a long time ago which did
the opposite of this. I've also been significantly LART'ed for doing that
with my malloc calls under other projects. Don't think that's the best
direction for us.
-Dormando
I really want to kill support for gcc 2.95 and below. Dealing with it
fuglifies the code a bit too much and it'd be really nice to be able to
stick with C99 standards.
There was one last holdout for gcc 2.95, and that was a freebsd 4.x user
who couldn't build under a newer gcc. Are you folks still out there and do
you still care? It's time to upgrade :\
-Dormando
On Jul 27, 2008, at 5:23 PM, Mike Panchenko wrote:
> I don't know what version of gcc we're on, but I know Yahoo! still
> has tons of FreeBSD 4 machines. Would you guys like me to forward
> this to the appropriate person/group to verify if that would affect
> us?
I am worried about Yahoo when it comes to most of this conversation. I
do not have the impression that they use a very modern version of GCC,
and that is going to be an issue I suspect.
Cheers,
-Brian
--
_______________________________________________________
Brian "Krow" Aker, brian at tangent.org
Seattle, Washington
http://krow.net/ <-- Me
http://tangent.org/ <-- Software
_______________________________________________________
You can't grep a dead tree.
Yes we use BSD4 heavily at Yahoo. Though we have been pushing hard for
over a year now to get everyone on RHEL (gcc 3.4).The gcc we use on
BSD is 2.95
--
Chris Goffinet
MyBlogLog Senior Performance Engineer
Yahoo!
San Francisco, CA
United States
I think its very safe to say its 'okay' to stop supporting GCC 2.95
(BSD4). At Yahoo we have phased out BSD4 (2.95) and are using BSD6
which has a gcc 3.4 compiler. We're good.
--
Chris Goffinet
MyBlogLog Senior Performance Engineer
Yahoo!
San Francisco, CA
United States