But if lack of a parameter name means unused (by choice) parameter, then 
compilers shouldn't warn that it is an unused parameter.

martin
________________________________________
From: [email protected] 
<[email protected]> on behalf of 
Kevin Kofler <[email protected]>
Sent: Thursday, October 16, 2014 7:46 PM
To: [email protected]
Subject: Re: [Development] Compiler warnings

Smith Martin wrote:
> But maintaining binary compatibility is now a necessary facet of software
> engineering, so maybe it is time for the C++ standard to support it. A
> keyword could be added to the parameter declaration, "compatibility" or
> "placeholder" for example, could precede a parameter declaration that is
> kept for binary compatibility. The compiler would not warn that the
> parameter was not used.

The lack of a name for the parameter is already how the C++ standard
specifies unused parameters, and g++ normally does NOT warn in that case.

In addition, GCC/g++ has supported __attribute__((unused)) for ages. For Qt
code, there's also the Q_UNUSED macro, which is used in the function itself,
and which should work with most (if not all) compilers out there. But all
those should not be needed in cases where you can simply omit the parameter
name.

        Kevin Kofler

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to