|
Packit |
33f14e |
/* A C macro for declaring that specific function parameters are not used.
|
|
Packit |
33f14e |
Copyright (C) 2008-2017 Free Software Foundation, Inc.
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
This program is free software: you can redistribute it and/or modify it
|
|
Packit |
33f14e |
under the terms of the GNU General Public License as published
|
|
Packit |
33f14e |
by the Free Software Foundation; either version 3 of the License, or
|
|
Packit |
33f14e |
(at your option) any later version.
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
This program is distributed in the hope that it will be useful,
|
|
Packit |
33f14e |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
33f14e |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
33f14e |
General Public License for more details.
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
You should have received a copy of the GNU General Public License
|
|
Packit |
33f14e |
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
|
Packit |
33f14e |
|
|
Packit |
33f14e |
/* _GL_UNUSED_PARAMETER is a marker that can be appended to function parameter
|
|
Packit |
33f14e |
declarations for parameters that are not used. This helps to reduce
|
|
Packit |
33f14e |
warnings, such as from GCC -Wunused-parameter. The syntax is as follows:
|
|
Packit |
33f14e |
type param _GL_UNUSED_PARAMETER
|
|
Packit |
33f14e |
or more generally
|
|
Packit |
33f14e |
param_decl _GL_UNUSED_PARAMETER
|
|
Packit |
33f14e |
For example:
|
|
Packit |
33f14e |
int param _GL_UNUSED_PARAMETER
|
|
Packit |
33f14e |
int *(*param)(void) _GL_UNUSED_PARAMETER
|
|
Packit |
33f14e |
Other possible, but obscure and discouraged syntaxes:
|
|
Packit |
33f14e |
int _GL_UNUSED_PARAMETER *(*param)(void)
|
|
Packit |
33f14e |
_GL_UNUSED_PARAMETER int *(*param)(void)
|
|
Packit |
33f14e |
*/
|
|
Packit |
33f14e |
#ifndef _GL_UNUSED_PARAMETER
|
|
Packit |
33f14e |
# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
|
|
Packit |
33f14e |
# define _GL_UNUSED_PARAMETER __attribute__ ((__unused__))
|
|
Packit |
33f14e |
# else
|
|
Packit |
33f14e |
# define _GL_UNUSED_PARAMETER
|
|
Packit |
33f14e |
# endif
|
|
Packit |
33f14e |
#endif
|