diff options
| author | Daniel Tang <dt.tangr@gmail.com> | 2013-06-08 22:33:55 -0400 |
|---|---|---|
| committer | Michal Marek <mmarek@suse.cz> | 2013-07-03 08:30:40 -0400 |
| commit | 04130cc973a96df33b1429024fd6dec59fa35a84 (patch) | |
| tree | bf7d1df446dce7eba88285b6a918914a8ce0e65e /scripts | |
| parent | bd70134396622ea50b14e34dae0810879884d553 (diff) | |
Fix a build warning in scripts/mod/file2alias.c
On some systems, __used is already defined in sys/cdefs.h and causes
a build warning:
scripts/mod/file2alias.c:85:1: warning: "__used" redefined
In file included from /usr/include/stdio.h:64,
from scripts/mod/modpost.h:1,
from scripts/mod/file2alias.c:13:
/usr/include/sys/cdefs.h:146:1: warning: this is the location of the previous definition
This adds an extra check before defining the __used macro to see if
the macro was already defined elsewhere.
Signed-off-by: Daniel Tang <dt.tangr@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/mod/file2alias.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 45f9a3377dcd..ab554564569a 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
| @@ -79,10 +79,12 @@ struct devtable **__start___devtable, **__stop___devtable; | |||
| 79 | extern struct devtable *__start___devtable[], *__stop___devtable[]; | 79 | extern struct devtable *__start___devtable[], *__stop___devtable[]; |
| 80 | #endif /* __MACH__ */ | 80 | #endif /* __MACH__ */ |
| 81 | 81 | ||
| 82 | #if __GNUC__ == 3 && __GNUC_MINOR__ < 3 | 82 | #if !defined(__used) |
| 83 | # define __used __attribute__((__unused__)) | 83 | # if __GNUC__ == 3 && __GNUC_MINOR__ < 3 |
| 84 | #else | 84 | # define __used __attribute__((__unused__)) |
| 85 | # define __used __attribute__((__used__)) | 85 | # else |
| 86 | # define __used __attribute__((__used__)) | ||
| 87 | # endif | ||
| 86 | #endif | 88 | #endif |
| 87 | 89 | ||
| 88 | /* Define a variable f that holds the value of field f of struct devid | 90 | /* Define a variable f that holds the value of field f of struct devid |
