diff options
author | Brian Behlendorf <[email protected]> | 2011-04-19 09:26:48 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2011-04-19 09:41:41 -0700 |
commit | 03318641afc3e2d6dc18614aaa75d6a0125cb933 (patch) | |
tree | 551de9d0c11d07ec8b0bb04299f6fcd765eb5da9 /configure | |
parent | 9b0f9079d22f5a13903d3da4d94e8e306cfa40dd (diff) |
Fix gcc configure warnings
Newer versions of gcc are getting smart enough to detect the sloppy
syntax used for the autoconf tests. It is now generating warnings
for unused/undeclared variables. Newer version of gcc even have
the -Wunused-but-set-variable option set by default. This isn't a
problem except when -Werror is set and they get promoted to an error.
In this case the autoconf test will return an incorrect result which
will result in a build failure latter on.
To handle this I'm tightening up many of the autoconf tests to
explicitly mark variables as unused to suppress the gcc warning.
Remember, all of the autoconf code can never actually be run we
just want to get a clean build error to detect which APIs are
available. Never using a variable is absolutely fine for this.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 90 |
1 files changed, 50 insertions, 40 deletions
@@ -11989,7 +11989,7 @@ int main (void) { - atomic64_t *ptr; + atomic64_t *ptr __attribute__ ((unused)); ; return 0; @@ -12232,7 +12232,7 @@ int main (void) { - uintptr_t *ptr; + uintptr_t *ptr __attribute__ ((unused)); ; return 0; @@ -12296,7 +12296,7 @@ int main (void) { - struct work_struct work; + struct work_struct work __attribute__ ((unused)); INIT_WORK(&work, NULL, NULL); ; @@ -12361,7 +12361,7 @@ int main (void) { - return register_sysctl_table(NULL,0); + (void) register_sysctl_table(NULL, 0); ; return 0; @@ -12563,7 +12563,7 @@ int main (void) { - struct nameidata nd; + struct nameidata nd __attribute__ ((unused)); nd.path.mnt = NULL; nd.path.dentry = NULL; @@ -12738,7 +12738,7 @@ int main (void) { - struct ctl_table ctl; + struct ctl_table ctl __attribute__ ((unused)); ctl.ctl_name = 0; ; @@ -13124,7 +13124,9 @@ int main (void) { - struct timespec a, b, c = { 0 }; + struct timespec a = { 0 }; + struct timespec b = { 0 }; + struct timespec c __attribute__ ((unused)); c = timespec_sub(a, b); ; @@ -13190,7 +13192,8 @@ int main (void) { - struct new_utsname *a = init_utsname(); + struct new_utsname *a __attribute__ ((unused)); + a = init_utsname(); ; return 0; @@ -13328,7 +13331,8 @@ main (void) { struct files_struct *files = current->files; - struct fdtable *fdt = files_fdtable(files); + struct fdtable *fdt __attribute__ ((unused)); + fdt = files_fdtable(files); ; return 0; @@ -13461,7 +13465,8 @@ int main (void) { - void *a = kmalloc_node(1, GFP_KERNEL, 0); + void *a __attribute__ ((unused)); + a = kmalloc_node(1, GFP_KERNEL, 0); ; return 0; @@ -13634,7 +13639,7 @@ int main (void) { - struct mutex mtx; + struct mutex mtx __attribute__ ((unused)); mtx.owner = NULL; ; @@ -14096,7 +14101,7 @@ int main (void) { - unsigned long state; + unsigned long state __attribute__ ((unused)); state = global_page_state(0); ; @@ -14162,7 +14167,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_FREE_PAGES; ; @@ -14228,7 +14233,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_INACTIVE; ; @@ -14293,7 +14298,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_INACTIVE_ANON; ; @@ -14358,7 +14363,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_INACTIVE_FILE; ; @@ -14424,7 +14429,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_ACTIVE; ; @@ -14489,7 +14494,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_ACTIVE_ANON; ; @@ -14554,7 +14559,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_ACTIVE_FILE; ; @@ -15080,7 +15085,7 @@ int main (void) { - struct cred *cr; + struct cred *cr __attribute__ ((unused)); cr = NULL; ; @@ -15957,7 +15962,7 @@ int main (void) { - atomic64_t *ptr; + atomic64_t *ptr __attribute__ ((unused)); ; return 0; @@ -16200,7 +16205,7 @@ int main (void) { - uintptr_t *ptr; + uintptr_t *ptr __attribute__ ((unused)); ; return 0; @@ -16264,7 +16269,7 @@ int main (void) { - struct work_struct work; + struct work_struct work __attribute__ ((unused)); INIT_WORK(&work, NULL, NULL); ; @@ -16329,7 +16334,7 @@ int main (void) { - return register_sysctl_table(NULL,0); + (void) register_sysctl_table(NULL, 0); ; return 0; @@ -16531,7 +16536,7 @@ int main (void) { - struct nameidata nd; + struct nameidata nd __attribute__ ((unused)); nd.path.mnt = NULL; nd.path.dentry = NULL; @@ -16706,7 +16711,7 @@ int main (void) { - struct ctl_table ctl; + struct ctl_table ctl __attribute__ ((unused)); ctl.ctl_name = 0; ; @@ -17092,7 +17097,9 @@ int main (void) { - struct timespec a, b, c = { 0 }; + struct timespec a = { 0 }; + struct timespec b = { 0 }; + struct timespec c __attribute__ ((unused)); c = timespec_sub(a, b); ; @@ -17158,7 +17165,8 @@ int main (void) { - struct new_utsname *a = init_utsname(); + struct new_utsname *a __attribute__ ((unused)); + a = init_utsname(); ; return 0; @@ -17296,7 +17304,8 @@ main (void) { struct files_struct *files = current->files; - struct fdtable *fdt = files_fdtable(files); + struct fdtable *fdt __attribute__ ((unused)); + fdt = files_fdtable(files); ; return 0; @@ -17429,7 +17438,8 @@ int main (void) { - void *a = kmalloc_node(1, GFP_KERNEL, 0); + void *a __attribute__ ((unused)); + a = kmalloc_node(1, GFP_KERNEL, 0); ; return 0; @@ -17602,7 +17612,7 @@ int main (void) { - struct mutex mtx; + struct mutex mtx __attribute__ ((unused)); mtx.owner = NULL; ; @@ -18064,7 +18074,7 @@ int main (void) { - unsigned long state; + unsigned long state __attribute__ ((unused)); state = global_page_state(0); ; @@ -18130,7 +18140,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_FREE_PAGES; ; @@ -18196,7 +18206,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_INACTIVE; ; @@ -18261,7 +18271,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_INACTIVE_ANON; ; @@ -18326,7 +18336,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_INACTIVE_FILE; ; @@ -18392,7 +18402,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_ACTIVE; ; @@ -18457,7 +18467,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_ACTIVE_ANON; ; @@ -18522,7 +18532,7 @@ int main (void) { - enum zone_stat_item zsi; + enum zone_stat_item zsi __attribute__ ((unused)); zsi = NR_ACTIVE_FILE; ; @@ -19048,7 +19058,7 @@ int main (void) { - struct cred *cr; + struct cred *cr __attribute__ ((unused)); cr = NULL; ; |