Add -Werror to arch/x86/ files only and fix warnings
Subsystems (8)
Hello Ingo,
As per your suggestion, I added -Werror for x86/files only and fix all remaining warnings on 32-bit and 64-bit defconfig and allnoconfig.
Here is pull request:
The following changes since commit 3965887240cb092f0d568b53165da6a215c7937a:
Ingo Molnar (1):
Merge branch 'linus'
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-tip.git master
Jaswinder Singh Rajput (2):
x86: Adding -Werror to arch/x86/ files only
x86: k8.h convert node_to_k8_nb_misc() from a macro to an inline function
arch/x86/boot/Makefile | 3 +++ arch/x86/boot/compressed/Makefile | 3 +++ arch/x86/crypto/Makefile | 3 +++ arch/x86/ia32/Makefile | 3 +++ arch/x86/include/asm/k8.h | 11 ++++++++--- arch/x86/kernel/Makefile | 3 +++ arch/x86/kernel/acpi/Makefile | 3 +++ arch/x86/kernel/acpi/realmode/Makefile | 3 +++ arch/x86/kernel/apic/Makefile | 3 +++ arch/x86/kernel/cpu/Makefile | 3 +++ arch/x86/kernel/cpu/cpufreq/Makefile | 3 +++ arch/x86/kernel/cpu/mcheck/Makefile | 3 +++ arch/x86/kernel/cpu/mtrr/Makefile | 3 +++ arch/x86/kvm/Makefile | 3 +++ arch/x86/lguest/Makefile | 3 +++ arch/x86/lib/Makefile | 3 +++ arch/x86/math-emu/Makefile | 3 +++ arch/x86/mm/Makefile | 3 +++ arch/x86/mm/kmemcheck/Makefile | 3 +++ arch/x86/oprofile/Makefile | 3 +++ arch/x86/pci/Makefile | 3 +++ arch/x86/power/Makefile | 3 +++ arch/x86/vdso/Makefile | 4 +++- arch/x86/video/Makefile | 3 +++ arch/x86/xen/Makefile | 5 ++++- 25 files changed, 81 insertions(+), 5 deletions(-)
Complete diff:
arch/x86/boot/Makefile +3 -0
@@ -22,6 +22,9 @@ ROOT_DEV := CURRENT SVGA_MODE := -DSVGA_MODE=NORMAL_VGA +# Make all warnings into errors +ccflags-y := -Werror + targets := vmlinux.bin setup.bin setup.elf bzImage targets += fdimage fdimage144 fdimage288 image.iso mtools.conf subdir- := compressed
arch/x86/boot/compressed/Makefile +3 -0
@@ -4,6 +4,9 @@ # create a compressed vmlinux image from the original vmlinux # +# Make all warnings into errors +ccflags-y := -Werror + targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma head_$(BITS).o misc.o piggy.o KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
arch/x86/crypto/Makefile +3 -0
@@ -2,6 +2,9 @@ # Arch-specific CryptoAPI modules. # +# Make all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o obj-$(CONFIG_CRYPTO_SALSA20_586) += salsa20-i586.o
arch/x86/ia32/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for the ia32 kernel emulation subsystem. # +# Make all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_signal.o sysv-$(CONFIG_SYSVIPC) := ipc32.o
arch/x86/include/asm/k8.h +8 -3
@@ -13,10 +13,15 @@ extern void k8_flush_garts(void);extern int k8_scan_nodes (unsigned long start,unsigned long end);#ifdef CONFIG_K8_NB -#define node_to_k8_nb_misc (node) \ - (node < num_k8_northbridges) ? k8_northbridges[node] : NULL +static inline struct pci_dev *node_to_k8_nb_misc (int node) +{ +return (node < num_k8_northbridges) ? k8_northbridges[node] :NULL ; +}#else -#define node_to_k8_nb_misc (node) NULL +static inline struct pci_dev *node_to_k8_nb_misc (int node) +{ +return NULL ; +}#endif
arch/x86/kernel/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for the linux kernel. # +# Make all warnings into errors +ccflags-y := -Werror + extra-y := head_$(BITS).o head$(BITS).o head.o init_task.o vmlinux.lds CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
arch/x86/kernel/acpi/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Make all warnings into errors +ccflags-y := -Werror + subdir- := realmode obj-$(CONFIG_ACPI) += boot.o
arch/x86/kernel/acpi/realmode/Makefile +3 -0
@@ -6,6 +6,9 @@ # for more details. # +# Make all warnings into errors +ccflags-y := -Werror + always := wakeup.bin targets := wakeup.elf wakeup.lds
arch/x86/kernel/apic/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for local APIC drivers and for the IO-APIC code # +# Make all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_X86_LOCAL_APIC) += apic.o probe_$(BITS).o ipi.o nmi.o obj-$(CONFIG_X86_IO_APIC) += io_apic.o obj-$(CONFIG_SMP) += ipi.o
arch/x86/kernel/cpu/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for x86-compatible CPU details, features and quirks # +# Make all warnings into errors +ccflags-y := -Werror + # Don't trace early stages of a secondary CPU boot ifdef CONFIG_FUNCTION_TRACER CFLAGS_REMOVE_common.o = -pg
arch/x86/kernel/cpu/cpufreq/Makefile +3 -0
@@ -2,6 +2,9 @@ # K8 systems. ACPI is preferred to all other hardware-specific drivers. # speedstep-* is preferred over p4-clockmod. +# Make all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o
arch/x86/kernel/cpu/mcheck/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Make all warnings into errors +ccflags-y := -Werror + obj-y = mce_$(BITS).o therm_throt.o obj-$(CONFIG_X86_32) += k7.o p4.o p5.o p6.o winchip.o
arch/x86/kernel/cpu/mtrr/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Make all warnings into errors +ccflags-y := -Werror + obj-y := main.o if.o generic.o state.o cleanup.o obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o
arch/x86/kvm/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for Kernel-based Virtual Machine module # +# Make all warnings into errors +ccflags-y := -Werror + common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \ coalesced_mmio.o irq_comm.o) ifeq ($(CONFIG_KVM_TRACE),y)
arch/x86/lguest/Makefile +3 -0
@@ -1 +1,4 @@ +# Make all warnings into errors +ccflags-y := -Werror + obj-y := i386_head.o boot.o
arch/x86/lib/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for x86 specific library files. # +# Make all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_SMP) := msr-on-cpu.o lib-y := delay.o
arch/x86/math-emu/Makefile +3 -0
@@ -8,6 +8,9 @@ PARANOID = -DPARANOID EXTRA_CFLAGS := $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION) EXTRA_AFLAGS := $(PARANOID) +# Make all warnings into errors +ccflags-y := -Werror + # From 'C' language sources: C_OBJS =fpu_entry.o errors.o \ fpu_arith.o fpu_aux.o fpu_etc.o fpu_tags.o fpu_trig.o \
arch/x86/mm/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Make all warnings into errors +ccflags-y := -Werror + obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \ pat.o pgtable.o gup.o
arch/x86/mm/kmemcheck/Makefile +3 -0
@@ -1 +1,4 @@ +# Make all warnings into errors +ccflags-y := -Werror + obj-y := error.o kmemcheck.o opcode.o pte.o selftest.o shadow.o
arch/x86/oprofile/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Make all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_OPROFILE) += oprofile.o DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
arch/x86/pci/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Make all warnings into errors +ccflags-y := -Werror + obj-y := i386.o init.o obj-$(CONFIG_PCI_BIOS) += pcbios.o
arch/x86/power/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Make all warnings into errors +ccflags-y := -Werror + # __restore_processor_state() restores %gs after S3 resume and so should not # itself be stack-protected nostackp := $(call cc-option, -fno-stack-protector)
arch/x86/vdso/Makefile +3 -1
@@ -2,6 +2,9 @@ # Building vDSO images for x86. # +# Make all warnings into errors +ccflags-y := -Werror + VDSO64-$(CONFIG_X86_64) := y VDSO32-$(CONFIG_X86_32) := y VDSO32-$(CONFIG_COMPAT) := y
@@ -9,7 +12,6 @@ VDSO32-$(CONFIG_COMPAT) := y vdso-install-$(VDSO64-y) += vdso.so vdso-install-$(VDSO32-y) += $(vdso32-images) - # files to link into the vdso vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o vvar.o
arch/x86/video/Makefile +3 -0
@@ -1 +1,4 @@ +# Make all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_FB) += fbdev.o
arch/x86/xen/Makefile +4 -1
@@ -1,3 +1,6 @@ +# Make all warnings into errors +ccflags-y := -Werror + ifdef CONFIG_FUNCTION_TRACER # Do not profile debug and lowlevel utilities CFLAGS_REMOVE_spinlock.o = -pg
@@ -10,4 +13,4 @@ obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ grant-table.o suspend.o obj-$(CONFIG_SMP) += smp.o spinlock.o -obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o +obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o
Quoted 52 lines · Jaswinder Singh Rajput
Hello Ingo,
As per your suggestion, I added -Werror for x86/files only and fix all remaining warnings on 32-bit and 64-bit defconfig and allnoconfig.
Here is pull request:
The following changes since commit3965887240cb092f0d568b53165da6a215c7937a:
Ingo Molnar (1):
Merge branch 'linus'are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-tip.gitmasterJaswinder Singh Rajput (2):
x86: Adding -Werror toarch/x86/files only
x86:k8.hconvertnode_to_k8_nb_misc()from a macro to an inline functionarch/x86/boot/Makefile | 3 +++ arch/x86/boot/compressed/Makefile | 3 +++ arch/x86/crypto/Makefile | 3 +++ arch/x86/ia32/Makefile | 3 +++ arch/x86/include/asm/k8.h | 11 ++++++++--- arch/x86/kernel/Makefile | 3 +++ arch/x86/kernel/acpi/Makefile | 3 +++ arch/x86/kernel/acpi/realmode/Makefile | 3 +++ arch/x86/kernel/apic/Makefile | 3 +++ arch/x86/kernel/cpu/Makefile | 3 +++ arch/x86/kernel/cpu/cpufreq/Makefile | 3 +++ arch/x86/kernel/cpu/mcheck/Makefile | 3 +++ arch/x86/kernel/cpu/mtrr/Makefile | 3 +++ arch/x86/kvm/Makefile | 3 +++ arch/x86/lguest/Makefile | 3 +++ arch/x86/lib/Makefile | 3 +++ arch/x86/math-emu/Makefile | 3 +++ arch/x86/mm/Makefile | 3 +++ arch/x86/mm/kmemcheck/Makefile | 3 +++ arch/x86/oprofile/Makefile | 3 +++ arch/x86/pci/Makefile | 3 +++ arch/x86/power/Makefile | 3 +++ arch/x86/vdso/Makefile | 4 +++- arch/x86/video/Makefile | 3 +++ arch/x86/xen/Makefile | 5 ++++- 25 files changed, 81 insertions(+), 5 deletions(-)Complete diff:
arch/x86/boot/Makefile +0
-0
arch/x86/boot/Makefile ROOT_DEV := CURRENT · line 25
Quoted 4 lines
arch/x86/boot/Makefile +1
-0@@ -22,6 +22,9 @@ ROOT_DEV := CURRENT SVGA_MODE := -DSVGA_MODE=NORMAL_VGA +# Make all warnings into errors
=> 'Turn all warnings into errors'
Quoted 9 lines
arch/x86/boot/Makefile +2
-0+ccflags-y := -Werror + targets := vmlinux.bin setup.bin setup.elf bzImage targets += fdimage fdimage144 fdimage288 image.iso mtools.conf subdir- := compressed
arch/x86/mm/Makefile line 5
Quoted 5 lines
arch/x86/mm/Makefile +3
-0@@ -1,3 +1,6 @@ +# Make all warnings into errors +ccflags-y := -Werror + obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \ pat.o pgtable.o gup.o
i'd suggest to right-align this obj-y rule as well, to move it in line with the other lines.
Looks good otherwise.
Sam, any second thoughts?
Ingo
Quoted 23 lines · Ingo Molnar
Quoted 2 lines
+# Make all warnings into errors
=> 'Turn all warnings into errors'
Quoted 9 lines
(quoted diff) +2
-0+ccflags-y := -Werror + targets := vmlinux.bin setup.bin setup.elf bzImage targets += fdimage fdimage144 fdimage288 image.iso mtools.conf subdir- := compressedarch/x86/mm/Makefile line 5
Quoted 5 lines
arch/x86/mm/Makefile +3
-0@@ -1,3 +1,6 @@ +# Make all warnings into errors +ccflags-y := -Werror + obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \ pat.o pgtable.o gup.oi'd suggest to right-align this obj-y rule as well, to move it in line with the other lines.
Quoted 2 lines
Looks good otherwise.
Ok here is the updated patch:
Subject: [PATCH] x86: Adding -Werror to arch/x86/ files only
Adding -Werror to arch/x86/ files only, to turn all warnings into errors.
--- arch/x86/boot/Makefile | 3 +++ arch/x86/boot/compressed/Makefile | 3 +++ arch/x86/crypto/Makefile | 3 +++ arch/x86/ia32/Makefile | 3 +++ arch/x86/kernel/Makefile | 3 +++ arch/x86/kernel/acpi/Makefile | 3 +++ arch/x86/kernel/acpi/realmode/Makefile | 3 +++ arch/x86/kernel/apic/Makefile | 3 +++ arch/x86/kernel/cpu/Makefile | 3 +++ arch/x86/kernel/cpu/cpufreq/Makefile | 3 +++ arch/x86/kernel/cpu/mcheck/Makefile | 3 +++ arch/x86/kernel/cpu/mtrr/Makefile | 3 +++ arch/x86/kvm/Makefile | 3 +++ arch/x86/lguest/Makefile | 3 +++ arch/x86/lib/Makefile | 3 +++ arch/x86/math-emu/Makefile | 3 +++ arch/x86/mm/Makefile | 8 ++++++-- arch/x86/mm/kmemcheck/Makefile | 5 ++++- arch/x86/oprofile/Makefile | 3 +++ arch/x86/pci/Makefile | 3 +++ arch/x86/power/Makefile | 3 +++ arch/x86/vdso/Makefile | 4 +++- arch/x86/video/Makefile | 5 ++++- arch/x86/xen/Makefile | 5 ++++- 24 files changed, 78 insertions(+), 6 deletions(-)
arch/x86/boot/Makefile +3 -0
@@ -22,6 +22,9 @@ ROOT_DEV := CURRENT SVGA_MODE := -DSVGA_MODE=NORMAL_VGA +# Turn all warnings into errors +ccflags-y := -Werror + targets := vmlinux.bin setup.bin setup.elf bzImage targets += fdimage fdimage144 fdimage288 image.iso mtools.conf subdir- := compressed
arch/x86/boot/compressed/Makefile +3 -0
@@ -4,6 +4,9 @@ # create a compressed vmlinux image from the original vmlinux # +# Turn all warnings into errors +ccflags-y := -Werror + targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma head_$(BITS).o misc.o piggy.o KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
arch/x86/crypto/Makefile +3 -0
@@ -2,6 +2,9 @@ # Arch-specific CryptoAPI modules. # +# Turn all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o obj-$(CONFIG_CRYPTO_SALSA20_586) += salsa20-i586.o
arch/x86/ia32/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for the ia32 kernel emulation subsystem. # +# Turn all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_signal.o sysv-$(CONFIG_SYSVIPC) := ipc32.o
arch/x86/kernel/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for the linux kernel. # +# Turn all warnings into errors +ccflags-y := -Werror + extra-y := head_$(BITS).o head$(BITS).o head.o init_task.o vmlinux.lds CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
arch/x86/kernel/acpi/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Turn all warnings into errors +ccflags-y := -Werror + subdir- := realmode obj-$(CONFIG_ACPI) += boot.o
arch/x86/kernel/acpi/realmode/Makefile +3 -0
@@ -6,6 +6,9 @@ # for more details. # +# Turn all warnings into errors +ccflags-y := -Werror + always := wakeup.bin targets := wakeup.elf wakeup.lds
arch/x86/kernel/apic/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for local APIC drivers and for the IO-APIC code # +# Turn all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_X86_LOCAL_APIC) += apic.o probe_$(BITS).o ipi.o nmi.o obj-$(CONFIG_X86_IO_APIC) += io_apic.o obj-$(CONFIG_SMP) += ipi.o
arch/x86/kernel/cpu/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for x86-compatible CPU details, features and quirks # +# Turn all warnings into errors +ccflags-y := -Werror + # Don't trace early stages of a secondary CPU boot ifdef CONFIG_FUNCTION_TRACER CFLAGS_REMOVE_common.o = -pg
arch/x86/kernel/cpu/cpufreq/Makefile +3 -0
@@ -2,6 +2,9 @@ # K8 systems. ACPI is preferred to all other hardware-specific drivers. # speedstep-* is preferred over p4-clockmod. +# Turn all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o
arch/x86/kernel/cpu/mcheck/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Turn all warnings into errors +ccflags-y := -Werror + obj-y = mce_$(BITS).o therm_throt.o obj-$(CONFIG_X86_32) += k7.o p4.o p5.o p6.o winchip.o
arch/x86/kernel/cpu/mtrr/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Turn all warnings into errors +ccflags-y := -Werror + obj-y := main.o if.o generic.o state.o cleanup.o obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o
arch/x86/kvm/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for Kernel-based Virtual Machine module # +# Turn all warnings into errors +ccflags-y := -Werror + common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \ coalesced_mmio.o irq_comm.o) ifeq ($(CONFIG_KVM_TRACE),y)
arch/x86/lguest/Makefile +3 -0
@@ -1 +1,4 @@ +# Turn all warnings into errors +ccflags-y := -Werror + obj-y := i386_head.o boot.o
arch/x86/lib/Makefile +3 -0
@@ -2,6 +2,9 @@ # Makefile for x86 specific library files. # +# Turn all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_SMP) := msr-on-cpu.o lib-y := delay.o
arch/x86/math-emu/Makefile +3 -0
@@ -8,6 +8,9 @@ PARANOID = -DPARANOID EXTRA_CFLAGS := $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION) EXTRA_AFLAGS := $(PARANOID) +# Turn all warnings into errors +ccflags-y := -Werror + # From 'C' language sources: C_OBJS =fpu_entry.o errors.o \ fpu_arith.o fpu_aux.o fpu_etc.o fpu_tags.o fpu_trig.o \
arch/x86/mm/Makefile +6 -2
@@ -1,5 +1,9 @@ -obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \ - pat.o pgtable.o gup.o +# Turn all warnings into errors +ccflags-y := -Werror + +obj-y := init.o init_$(BITS).o fault.o ioremap.o \ + extable.o pageattr.o mmap.o pat.o \ + pgtable.o gup.o obj-$(CONFIG_SMP) += tlb.o
arch/x86/mm/kmemcheck/Makefile +4 -1
@@ -1 +1,4 @@ -obj-y := error.o kmemcheck.o opcode.o pte.o selftest.o shadow.o +# Turn all warnings into errors +ccflags-y := -Werror + +obj-y := error.o kmemcheck.o opcode.o pte.o selftest.o shadow.o
arch/x86/oprofile/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Turn all warnings into errors +ccflags-y := -Werror + obj-$(CONFIG_OPROFILE) += oprofile.o DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
arch/x86/pci/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Turn all warnings into errors +ccflags-y := -Werror + obj-y := i386.o init.o obj-$(CONFIG_PCI_BIOS) += pcbios.o
arch/x86/power/Makefile +3 -0
@@ -1,3 +1,6 @@ +# Turn all warnings into errors +ccflags-y := -Werror + # __restore_processor_state() restores %gs after S3 resume and so should not # itself be stack-protected nostackp := $(call cc-option, -fno-stack-protector)
arch/x86/vdso/Makefile +3 -1
@@ -2,6 +2,9 @@ # Building vDSO images for x86. # +# Turn all warnings into errors +ccflags-y := -Werror + VDSO64-$(CONFIG_X86_64) := y VDSO32-$(CONFIG_X86_32) := y VDSO32-$(CONFIG_COMPAT) := y
@@ -9,7 +12,6 @@ VDSO32-$(CONFIG_COMPAT) := y vdso-install-$(VDSO64-y) += vdso.so vdso-install-$(VDSO32-y) += $(vdso32-images) - # files to link into the vdso vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o vvar.o
arch/x86/video/Makefile +4 -1
@@ -1 +1,4 @@ -obj-$(CONFIG_FB) += fbdev.o +# Turn all warnings into errors +ccflags-y := -Werror + +obj-$(CONFIG_FB) += fbdev.o
arch/x86/xen/Makefile +4 -1
@@ -1,3 +1,6 @@ +# Turn all warnings into errors +ccflags-y := -Werror + ifdef CONFIG_FUNCTION_TRACER # Do not profile debug and lowlevel utilities CFLAGS_REMOVE_spinlock.o = -pg
@@ -10,4 +13,4 @@ obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ grant-table.o suspend.o obj-$(CONFIG_SMP) += smp.o spinlock.o -obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o +obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o
Signature · 1 line
1.6.0.6
Quoted 24 lines · Jaswinder Singh Rajput
Quoted 23 lines · Ingo Molnar
Quoted 2 lines
+# Make all warnings into errors
=> 'Turn all warnings into errors'
Quoted 9 lines
(quoted diff) +2
-0+ccflags-y := -Werror + targets := vmlinux.bin setup.bin setup.elf bzImage targets += fdimage fdimage144 fdimage288 image.iso mtools.conf subdir- := compressedarch/x86/mm/Makefile line 5
Quoted 5 lines
arch/x86/mm/Makefile +3
-0@@ -1,3 +1,6 @@ +# Make all warnings into errors +ccflags-y := -Werror + obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \ pat.o pgtable.o gup.oi'd suggest to right-align this obj-y rule as well, to move it in line with the other lines.
Quoted 8 lines
Quoted 2 lines
Looks good otherwise.
Ok here is the updated patch:
Subject: [PATCH] x86: Adding -Werror to
arch/x86/files onlyAdding -Werror to
arch/x86/files only, to turn all warnings into errors.
Here is V2 of this patch where we can enable/disable this option:
Subject: [PATCH-tip] x86: Adding -Werror to arch/x86/ files only for !CONFIG_ALLOW_X86_WARNINGS
Adding -Werror to arch/x86/ files only, to turn all warnings into errors.
--- arch/x86/Kconfig | 9 +++++++++ arch/x86/boot/Makefile | 5 +++++ arch/x86/boot/compressed/Makefile | 5 +++++ arch/x86/crypto/Makefile | 5 +++++ arch/x86/ia32/Makefile | 5 +++++ arch/x86/kernel/Makefile | 5 +++++ arch/x86/kernel/acpi/Makefile | 5 +++++ arch/x86/kernel/acpi/realmode/Makefile | 5 +++++ arch/x86/kernel/apic/Makefile | 5 +++++ arch/x86/kernel/cpu/Makefile | 5 +++++ arch/x86/kernel/cpu/cpufreq/Makefile | 5 +++++ arch/x86/kernel/cpu/mcheck/Makefile | 5 +++++ arch/x86/kernel/cpu/mtrr/Makefile | 5 +++++ arch/x86/kvm/Makefile | 5 +++++ arch/x86/lguest/Makefile | 5 +++++ arch/x86/lib/Makefile | 5 +++++ arch/x86/math-emu/Makefile | 5 +++++ arch/x86/mm/Makefile | 10 ++++++++-- arch/x86/mm/kmemcheck/Makefile | 7 ++++++- arch/x86/oprofile/Makefile | 5 +++++ arch/x86/pci/Makefile | 5 +++++ arch/x86/power/Makefile | 5 +++++ arch/x86/vdso/Makefile | 6 +++++- arch/x86/video/Makefile | 7 ++++++- arch/x86/xen/Makefile | 7 ++++++- 25 files changed, 135 insertions(+), 6 deletions(-)
arch/x86/Kconfig +9 -0
@@ -171,6 +171,15 @@ config ARCH_SUPPORTS_OPTIMIZED_INLINING config ARCH_SUPPORTS_DEBUG_PAGEALLOC def_bool y +config ALLOW_X86_WARNINGS + bool "Continue building x86 despite compiler warnings" + default n + depends on ALLOW_WARNINGS + depends on DEBUG_KERNEL + help + By enabling this option you will disable -Werror on building + x86 C files only. + # Use the generic interrupt handling code in kernel/irq/: config GENERIC_HARDIRQS bool
arch/x86/boot/Makefile +5 -0
@@ -22,6 +22,11 @@ ROOT_DEV := CURRENT SVGA_MODE := -DSVGA_MODE=NORMAL_VGA +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + targets := vmlinux.bin setup.bin setup.elf bzImage targets += fdimage fdimage144 fdimage288 image.iso mtools.conf subdir- := compressed
arch/x86/boot/compressed/Makefile +5 -0
@@ -4,6 +4,11 @@ # create a compressed vmlinux image from the original vmlinux # +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma head_$(BITS).o misc.o piggy.o KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
arch/x86/crypto/Makefile +5 -0
@@ -2,6 +2,11 @@ # Arch-specific CryptoAPI modules. # +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o obj-$(CONFIG_CRYPTO_SALSA20_586) += salsa20-i586.o
arch/x86/ia32/Makefile +5 -0
@@ -2,6 +2,11 @@ # Makefile for the ia32 kernel emulation subsystem. # +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_signal.o sysv-$(CONFIG_SYSVIPC) := ipc32.o
arch/x86/kernel/Makefile +5 -0
@@ -2,6 +2,11 @@ # Makefile for the linux kernel. # +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + extra-y := head_$(BITS).o head$(BITS).o head.o init_task.o vmlinux.lds CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE)
arch/x86/kernel/acpi/Makefile +5 -0
@@ -1,3 +1,8 @@ +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + subdir- := realmode obj-$(CONFIG_ACPI) += boot.o
arch/x86/kernel/acpi/realmode/Makefile +5 -0
@@ -6,6 +6,11 @@ # for more details. # +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + always := wakeup.bin targets := wakeup.elf wakeup.lds
arch/x86/kernel/apic/Makefile +5 -0
@@ -2,6 +2,11 @@ # Makefile for local APIC drivers and for the IO-APIC code # +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + obj-$(CONFIG_X86_LOCAL_APIC) += apic.o probe_$(BITS).o ipi.o nmi.o obj-$(CONFIG_X86_IO_APIC) += io_apic.o obj-$(CONFIG_SMP) += ipi.o
arch/x86/kernel/cpu/Makefile +5 -0
@@ -2,6 +2,11 @@ # Makefile for x86-compatible CPU details, features and quirks # +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + # Don't trace early stages of a secondary CPU boot ifdef CONFIG_FUNCTION_TRACER CFLAGS_REMOVE_common.o = -pg
arch/x86/kernel/cpu/cpufreq/Makefile +5 -0
@@ -2,6 +2,11 @@ # K8 systems. ACPI is preferred to all other hardware-specific drivers. # speedstep-* is preferred over p4-clockmod. +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o
arch/x86/kernel/cpu/mcheck/Makefile +5 -0
@@ -1,3 +1,8 @@ +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + obj-y = mce_$(BITS).o therm_throt.o obj-$(CONFIG_X86_32) += k7.o p4.o p5.o p6.o winchip.o
arch/x86/kernel/cpu/mtrr/Makefile +5 -0
@@ -1,3 +1,8 @@ +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + obj-y := main.o if.o generic.o state.o cleanup.o obj-$(CONFIG_X86_32) += amd.o cyrix.o centaur.o
arch/x86/kvm/Makefile +5 -0
@@ -2,6 +2,11 @@ # Makefile for Kernel-based Virtual Machine module # +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + common-objs = $(addprefix ../../../virt/kvm/, kvm_main.o ioapic.o \ coalesced_mmio.o irq_comm.o) ifeq ($(CONFIG_KVM_TRACE),y)
arch/x86/lguest/Makefile +5 -0
@@ -1 +1,6 @@ +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + obj-y := i386_head.o boot.o
arch/x86/lib/Makefile +5 -0
@@ -2,6 +2,11 @@ # Makefile for x86 specific library files. # +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + obj-$(CONFIG_SMP) := msr-on-cpu.o lib-y := delay.o
arch/x86/math-emu/Makefile +5 -0
@@ -8,6 +8,11 @@ PARANOID = -DPARANOID EXTRA_CFLAGS := $(PARANOID) $(DEBUG) -fno-builtin $(MATH_EMULATION) EXTRA_AFLAGS := $(PARANOID) +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + # From 'C' language sources: C_OBJS =fpu_entry.o errors.o \ fpu_arith.o fpu_aux.o fpu_etc.o fpu_tags.o fpu_trig.o \
arch/x86/mm/Makefile +8 -2
@@ -1,5 +1,11 @@ -obj-y := init.o init_$(BITS).o fault.o ioremap.o extable.o pageattr.o mmap.o \ - pat.o pgtable.o gup.o +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + +obj-y := init.o init_$(BITS).o fault.o ioremap.o \ + extable.o pageattr.o mmap.o pat.o \ + pgtable.o gup.o obj-$(CONFIG_SMP) += tlb.o
arch/x86/mm/kmemcheck/Makefile +6 -1
@@ -1 +1,6 @@ -obj-y := error.o kmemcheck.o opcode.o pte.o selftest.o shadow.o +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + +obj-y := error.o kmemcheck.o opcode.o pte.o selftest.o shadow.o
arch/x86/oprofile/Makefile +5 -0
@@ -1,3 +1,8 @@ +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + obj-$(CONFIG_OPROFILE) += oprofile.o DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
arch/x86/pci/Makefile +5 -0
@@ -1,3 +1,8 @@ +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + obj-y := i386.o init.o obj-$(CONFIG_PCI_BIOS) += pcbios.o
arch/x86/power/Makefile +5 -0
@@ -1,3 +1,8 @@ +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + # __restore_processor_state() restores %gs after S3 resume and so should not # itself be stack-protected nostackp := $(call cc-option, -fno-stack-protector)
arch/x86/vdso/Makefile +5 -1
@@ -2,6 +2,11 @@ # Building vDSO images for x86. # +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + VDSO64-$(CONFIG_X86_64) := y VDSO32-$(CONFIG_X86_32) := y VDSO32-$(CONFIG_COMPAT) := y
@@ -9,7 +14,6 @@ VDSO32-$(CONFIG_COMPAT) := y vdso-install-$(VDSO64-y) += vdso.so vdso-install-$(VDSO32-y) += $(vdso32-images) - # files to link into the vdso vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o vvar.o
arch/x86/video/Makefile +6 -1
@@ -1 +1,6 @@ -obj-$(CONFIG_FB) += fbdev.o +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + +obj-$(CONFIG_FB) += fbdev.o
arch/x86/xen/Makefile +6 -1
@@ -1,3 +1,8 @@ +# Turn all warnings into errors +ifndef CONFIG_ALLOW_X86_WARNINGS +ccflags-y := -Werror +endif + ifdef CONFIG_FUNCTION_TRACER # Do not profile debug and lowlevel utilities CFLAGS_REMOVE_spinlock.o = -pg
@@ -10,4 +15,4 @@ obj-y := enlighten.o setup.o multicalls.o mmu.o irq.o \ grant-table.o suspend.o obj-$(CONFIG_SMP) += smp.o spinlock.o -obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o +obj-$(CONFIG_XEN_DEBUG_FS) += debugfs.o
Signature · 1 line
1.6.0.6
arch/x86/Kconfig config ARCH_SUPPORTS_OPTIMIZED_INLINING · line 181
Quoted 8 lines · Jaswinder Singh Rajput
arch/x86/Kconfig +8
-0+config ALLOW_X86_WARNINGS + bool "Continue building x86 despite compiler warnings" + default n + depends on ALLOW_WARNINGS + depends on DEBUG_KERNEL + help + By enabling this option you will disable -Werror on building + x86 C files only.
no, it should be something like this:
config ALLOW_X86_WARNINGS
bool "Continue building x86 despite compiler warnings" if DEBUG_KERNEL default y
help
By disabling this option you will enable -Werror builds:
i.e. any compiler warning will generate a build failure. (On arch/x86 files only)
Disabe this only if you have a reasonably recent compiler that does not emit bogus warnings and if you want to help with fixing warnings. Also choose this if you are an x86 developer trying to make sure that the patches you submit build warning-free. (The rest of the kernel can emit lots of build warnings - so your own warnings might be easy to miss.)
Choose Y if unsure.
Note the differences: this will be properly kept 'Y' in most situations (allyes, allmod, allno). Also note the explicit explanation in the help text.
Ingo
Quoted 1 line · On Wed, 15 Apr 2009 16:34:18 +0530 Jaswinder Singh Rajput…
I added -Werror for x86/files only
yikes.
Not only does this need to be tested for all configs, it also need to be tested for all approved gcc versions.
For example, one of my compilers always spews warnings from x86 because it has the "foo(&bar) doesn't initialise bar" stupidity.
And there will be other gcc inconsitencies, for sure.
Quoted 1 line
Subject: [PATCH-tip] x86: Adding -Werror to
arch/x86/files only for !CONFIG_ALLOW_X86_WARNINGS
whew, that sounds better.
Quoted 7 lines · Andrew Morton
Quoted 1 line · On Wed, 15 Apr 2009 16:34:18 +0530 Jaswinder Singh Rajput…
I added -Werror for x86/files only
yikes.
Quoted 7 lines
Not only does this need to be tested for all configs, it also need to be tested for all approved gcc versions.
For example, one of my compilers always spews warnings from x86 because it has the "
foo(&bar)doesn't initialise bar" stupidity.And there will be other gcc inconsitencies, for sure.
Yes.
Quoted 4 lines
Quoted 2 lines
Subject: [PATCH-tip] x86: Adding -Werror to
arch/x86/files only for !CONFIG_ALLOW_X86_WARNINGSwhew, that sounds better.
Yes, as requested by an equally worried x86 maintainer ;-)
Ingo