Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 12 Aug 2011 07:13:30 +0400
From: Solar Designer <solar@...nwall.com>
To: musl@...ts.openwall.com
Subject: Re: cluts daily reports 8/12 - continuing pthread_eintr, still stuck with alloc

On Thu, Aug 11, 2011 at 10:47:25PM -0400, Rich Felker wrote:
> On Fri, Aug 12, 2011 at 04:45:58AM +0200, Luka Mar??eti?? wrote:
> > static void 
> > child_wait_vp(void* foo)
> > {
> >     child_wait();
> >     ++foo; // -Wunused-parameter
> >     return;
> > }
> 
> This is invalid C. You cannot do arithmetic on void pointers.

Right.  It's a GNU extension that we don't want to depend on.

> I would
> really recommend -Wno-unused-parameter, as unused parameters are NOT a
> sign of bad code, but a fundamental part of using function pointers.

Rather than disable the warning, Luka can do:

	(void) foo;

which is portable, unlike "++foo", and it silences the gcc warning too.

In some cases, unused parameters do in fact indicate programming errors
(such as a typo that resulted in another variable being used), so the
warning is somewhat useful.

Alexander

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.