Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1441737 > unrolled thread

Re: [PATCH] CFLAGS: add -Wunused-but-set-parameter

Started byAndrew Morton <akpm@linux-foundation.org>
First post2016-07-12 23:30 +0200
Last post2016-07-13 21:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] CFLAGS: add -Wunused-but-set-parameter Andrew Morton <akpm@linux-foundation.org> - 2016-07-12 23:30 +0200
    [PATCH v2] CFLAGS: add -Wunused-but-set-parameter Alexey Dobriyan <adobriyan@gmail.com> - 2016-07-13 21:10 +0200

#1441737 — Re: [PATCH] CFLAGS: add -Wunused-but-set-parameter

FromAndrew Morton <akpm@linux-foundation.org>
Date2016-07-12 23:30 +0200
SubjectRe: [PATCH] CFLAGS: add -Wunused-but-set-parameter
Message-ID<rUdpE-21T-21@gated-at.bofh.it>
On Fri, 8 Jul 2016 00:43:06 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:

> -Wunused-but-set-parameter is finding stuff with current allmodconfig:
> 
> drivers/misc/mic/scif/scif_dma.c:118:27: warning: parameter 'ep' set but not used [-Wunused-but-set-parameter]
> drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c:2156:8: warning: parameter 'function' set but not used [-Wunused-but-set-parameter]
> drivers/net/ethernet/ti/tlan.c:1647:59: warning: parameter 'host_int' set but not used [-Wunused-but-set-parameter]
> drivers/usb/gadget/udc/pxa27x_udc.c:1828:74: warning: parameter 'driver' set but not used [-Wunused-but-set-parameter]
> 
> and judging by changelogs, people were using it before,
> but were too scared to touch top level Makefile.
>
> ...
>
> --- a/Makefile
> +++ b/Makefile
> @@ -399,6 +399,7 @@ KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
>  		   -Werror-implicit-function-declaration \
>  		   -Wno-format-security \
>  		   -std=gnu89
> +KBUILD_CFLAGS += -Wunused-but-set-parameter
>  
>  KBUILD_AFLAGS_KERNEL :=
>  KBUILD_CFLAGS_KERNEL :=

gcc-4.4.4:

  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CC      scripts/mod/empty.o
  CC      scripts/mod/devicetable-offsets.s
cc1: error: unrecognized command line option "-Wunused-but-set-parameter"
make[2]: *** [scripts/mod/empty.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc1: error: unrecognized command line option "-Wunused-but-set-parameter"
make[2]: *** [scripts/mod/devicetable-offsets.s] Error 1

[toc] | [next] | [standalone]


#1442775 — [PATCH v2] CFLAGS: add -Wunused-but-set-parameter

FromAlexey Dobriyan <adobriyan@gmail.com>
Date2016-07-13 21:10 +0200
Subject[PATCH v2] CFLAGS: add -Wunused-but-set-parameter
Message-ID<rUxHH-7fk-5@gated-at.bofh.it>
In reply to#1441737
-Wunused-but-set-parameter is finding stuff with current allmodconfig:

drivers/misc/mic/scif/scif_dma.c:118:27: warning: parameter 'ep' set but not used [-Wunused-but-set-parameter]
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c:2156:8: warning: parameter 'function' set but not used [-Wunused-but-set-parameter]
drivers/net/ethernet/ti/tlan.c:1647:59: warning: parameter 'host_int' set but not used [-Wunused-but-set-parameter]
drivers/usb/gadget/udc/pxa27x_udc.c:1828:74: warning: parameter 'driver' set but not used [-Wunused-but-set-parameter]

and judging by changelogs, people were using it before,
but were too scared to change top level Makefile.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

	Can't compile gcc that old :-(

 Makefile |    3 +++
 1 file changed, 3 insertions(+)

--- a/Makefile
+++ b/Makefile
@@ -796,6 +796,9 @@ KBUILD_CFLAGS   += $(call cc-option,-Werror=date-time)
 # enforce correct pointer usage
 KBUILD_CFLAGS   += $(call cc-option,-Werror=incompatible-pointer-types)
 
+# dead code
+KBUILD_CFLAGS += $(call cc-option,-Wunused-but-set-parameter,)
+
 # use the deterministic mode of AR if available
 KBUILD_ARFLAGS := $(call ar-option,D)
 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web