annotate build-aux/unused-parameter.h @ 13415:a884db63982b

Avoid some more warnings from "gcc -Wwrite-strings".
author Bruno Haible <bruno@clisp.org>
date Fri, 11 Jun 2010 21:17:11 +0200
parents c2cbabec01dd
children 97fc9a21a8fb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12500
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* A C macro for declaring that specific function parameters are not used.
12559
c2cbabec01dd update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents: 12500
diff changeset
2 Copyright (C) 2008-2010 Free Software Foundation, Inc.
12500
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software: you can redistribute it and/or modify it
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 under the terms of the GNU Lesser General Public License as published
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 by the Free Software Foundation; either version 2 of the License, or
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 (at your option) any later version.
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 Lesser General Public License for more details.
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU Lesser General Public License
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 /* _GL_UNUSED_PARAMETER is a marker that can be appended to function parameter
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 declarations for parameters that are not used. This helps to reduce
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 warnings, such as from GCC -Wunused-parameter. The syntax is as follows:
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 type param _GL_UNUSED_PARAMETER
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 or more generally
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 param_decl _GL_UNUSED_PARAMETER
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 For example:
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 int param _GL_UNUSED_PARAMETER
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 int *(*param)(void) _GL_UNUSED_PARAMETER
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 Other possible, but obscure and discouraged syntaxes:
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 int _GL_UNUSED_PARAMETER *(*param)(void)
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 _GL_UNUSED_PARAMETER int *(*param)(void)
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 */
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 #ifndef _GL_UNUSED_PARAMETER
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 # if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 # define _GL_UNUSED_PARAMETER __attribute__ ((__unused__))
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 # else
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 # define _GL_UNUSED_PARAMETER
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 # endif
e6877b45f4e6 New module 'unused-parameter'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 #endif