News for hackers. Stuff that matters.
Re:Android Project Changeset 4f8b683: libc/memset.c by ehnus on Tuesday May 25, 2010 @10:57PM (#1379379)
If assertions disappear in certain optimized builds then what do you do, or recommend, to deal with warnings related to unused parameters or values if you don't believe that casting to void has value?
Re:Android Project Changeset 4f8b683: libc/memset.c by tptacek on Wednesday May 26, 2010 @10:49AM (#1380396)
I don't understand how the question you ask even follows from the premise you forwarded. The fact that memset is probably always dead code here is why it's not really a bug. The fact that warnings about unused return values are useless 100-1000 times for every time they're potentially useful is why I don't litter my code with pointless casts.
Re:Android Project Changeset 4f8b683: libc/memset.c by scott_s on Tuesday May 25, 2010 @11:12PM (#1379408)
As I pointed out above, in gcc you can explicitly mark variables as potentially unused.
Re:Android Project Changeset 4f8b683: libc/memset.c by ehnus on Tuesday May 25, 2010 @11:43PM (#1379444)
And what do you suggest for MSVC, which doesn't support attribute unused or have any comparable declspecs?
Re:Android Project Changeset 4f8b683: libc/memset.c by scott_s on Wednesday May 26, 2010 @01:10AM (#1379579)
If what you say is true, then you have to either put up with the warnings, compile at a level that doesn't have the warnings, or figure out a hack around them - I don't like any of those options.

I'm not as dogmatic as some others are in the thread. I just think it's a good idea to be warned when a variable is unused, enough that I'll mark my very few that might be #ifdef'ed out. If you're using a compiler that doesn't let you mark variables as such... well that sucks. You do what you can.