News for hackers. Stuff that matters.
Re:Android Project Changeset 4f8b683: libc/memset.c by humbledrone on Tuesday May 25, 2010 @08:29PM (#1379129)
Huh? Any halfway decent software shop will have a policy of compiling with all warnings enabled, and fixing all sources of warnings (with only very rare exceptions). It is extremely unprofessional to disable or ignore warnings such as the "unused function parameter" warning. If you disagree, I respectfully submit that I would never let you near a C project that I was working on.
Re:Android Project Changeset 4f8b683: libc/memset.c by neilc on Tuesday May 25, 2010 @08:42PM (#1379163)
Any halfway decent software shop will have a policy of compiling with all warnings enabled

FWIW, your definition of "halfway decent" would exclude most software shops in the world.

It is extremely unprofessional to disable or ignore warnings such as the "unused function parameter" warning

Unused function parameter warnings are often noise (e.g., due to #ifdefs, unimplemented APIs, backward compatible APIs, etc). I agree that code should compile w/o warnings, but the benefits of tracking down and squelching unused function argument warnings are pretty marginal in my experience.

Re:Android Project Changeset 4f8b683: libc/memset.c by tptacek on Tuesday May 25, 2010 @08:50PM (#1379182)
All I can say is than in 15 years (fuck.) I've never worked on a team that would have caught a bug like this in dead code. -Wall has been the gold standard on the teams I've worked on.
Re:Android Project Changeset 4f8b683: libc/memset.c by josephruscio on Wednesday May 26, 2010 @12:29AM (#1379516)
-Wall unfortunately leaves a lot of warnings disabled. We've used:

"-W -Wall -Wcast-align -Wstrict-prototypes -Wmissing -prototypes -Wpointer-arith -Wshadow -Wsign-compare -Wformat=2 -Wno-format-y2k -Wimplicit -Wmissing-braces -Wnested-externs -Wparentheses -Wtrigraphs"

Update: Forgot the most important one ... -Werror. Making warnings equivalent to errors is the only way to ensure that they're always taken care of.

Re:Android Project Changeset 4f8b683: libc/memset.c by renata on Wednesday May 26, 2010 @02:30AM (#1379668)
-Wall doesn't enable -Wunused-parameter. You need -Wall -Wextra for that.
Re:Android Project Changeset 4f8b683: libc/memset.c by humbledrone on Tuesday May 25, 2010 @08:51PM (#1379187)
I would probably agree that most software shops in the world are not halfway decent.

The benefits of tracking down and squelching such warnings would have very likely caused this bug to never exist. The point is that you make "compiles without warnings" a policy, and you build a habit of maintaining that policy -- after a while it begins to take almost no effort at all.

Re:Android Project Changeset 4f8b683: libc/memset.c by tptacek on Tuesday May 25, 2010 @08:57PM (#1379195)
Do you write C code?
Re:Android Project Changeset 4f8b683: libc/memset.c by s3graham on Tuesday May 25, 2010 @09:18PM (#1379217)
(and for more than one platform?)
Re:Android Project Changeset 4f8b683: libc/memset.c by jey on Tuesday May 25, 2010 @08:39PM (#1379154)
The unused function parameter warning is usually one of the most annoying and least useful. I routinely compile with "-Wall -Wno-unused" because I don't want to litter my code with casts to void.
Re:Android Project Changeset 4f8b683: libc/memset.c by wvenable on Tuesday May 25, 2010 @10:04PM (#1379296)
What's with all the unused function parameters? Shouldn't that be an edge case?
Re:Android Project Changeset 4f8b683: libc/memset.c by tedunangst on Tuesday May 25, 2010 @10:21PM (#1379326)
Just about every callback interface takes a function pointer where the function expects a void * argument. Half the time it's not needed.
Re:Android Project Changeset 4f8b683: libc/memset.c by kelnos on Wednesday May 26, 2010 @06:04AM (#1379929)
If the void * is the last parameter, just leave it off your implementation of the callback function.