This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How do we write unused arguments?
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Earnshaw <Richard dot Earnshaw at foss dot arm dot com>
- Cc: Marek Polacek <polacek at redhat dot com>, Bernd Schmidt <bschmidt at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Thu, 5 Nov 2015 12:25:02 +0100
- Subject: Re: How do we write unused arguments?
- Authentication-results: sourceware.org; auth=none
- References: <563B221B dot 9070806 at redhat dot com> <20151105104524 dot GU3185 at redhat dot com> <20151105104855 dot GW478 at tucnak dot redhat dot com> <563B3B48 dot 1020600 at foss dot arm dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Nov 05, 2015 at 11:19:36AM +0000, Richard Earnshaw wrote:
> > It depends, if the argument is conditionally (based on preprocessor macros)
> > used, then we need the first form.
> > If it is completely unused, I also prefer the last form, but there are cases
> > where one wants to document the purpose of the unused argument or something
> > similar and in that case the third one is useful.
>
> Except, of course, that we're moving away from conditionally compiled
> code, so we should never need the first (or second) forms.
It will take time, there are still many target macros with arguments,
some of which are not used on all targets, and converting some of those
macros to hooks might be performance problem.
Jakub