On Sat, Jul 21, 2007 at 09:22:40PM +0200, svn@openbios.org wrote:
fix somw printk calls and print warnings for those that still need to be fixed. (trivial)
Signed-off-by: Stefan Reinauer stepan@coresystems.de Acked-by: Stefan Reinauer stepan@coresystems.de
Modified: LinuxBIOSv3/include/console.h
--- LinuxBIOSv3/include/console.h 2007-07-21 14:33:54 UTC (rev 461) +++ LinuxBIOSv3/include/console.h 2007-07-21 19:22:40 UTC (rev 462) @@ -46,6 +46,7 @@ };
// -int printk(int msg_level, const char *fmt, ...); +int printk(int msg_level, const char *fmt, ...)
- __attribute__((format (printf, 2, 3)));
This is causing quite a bunch of additional warnings, see below:
CP build/config.h GEN build/build.h BUILD DUMMY VPD CC build/lib/uart8250.o CC build/lib/mem.o CC build/lib/elfboot.o /tmp/v3_fresh/lib/elfboot.c: In function ‘load_elf_segments’: /tmp/v3_fresh/lib/elfboot.c:105: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 3 has type ‘Elf32_Addr’ /tmp/v3_fresh/lib/elfboot.c:105: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 4 has type ‘Elf32_Word’ /tmp/v3_fresh/lib/elfboot.c:105: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 5 has type ‘Elf32_Off’ /tmp/v3_fresh/lib/elfboot.c:105: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 6 has type ‘Elf32_Word’ /tmp/v3_fresh/lib/elfboot.c:112: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 3 has type ‘Elf32_Addr’ /tmp/v3_fresh/lib/elfboot.c:112: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 4 has type ‘int’ /tmp/v3_fresh/lib/elfboot.c:112: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 5 has type ‘Elf32_Off’ /tmp/v3_fresh/lib/elfboot.c: In function ‘elfload’: /tmp/v3_fresh/lib/elfboot.c:153: warning: format ‘%x’ expects type ‘unsigned int’, but argument 3 has type ‘void *’ CC build/lib/lar.o CC build/lib/delay.o CC build/lib/vtxprintf.o CC build/lib/vsprintf.o CC build/lib/console.o CC build/lib/lzma.o CC build/arch/x86/stage1.o CC build/arch/x86/serial.o CC build/arch/x86/archelfboot.o CC build/arch/x86/speaker.o CC build/arch/x86/udelay_io.o CC build/arch/x86/mc146818rtc.o CC build/arch/x86/stage0_i586.o AS build/arch/x86/stage0_i586.o CC build/mainboard/emulation/qemu-x86/stage1.o CC build/stage0.init OBJCOPY build/stage0.init TEST build/stage0.init BUILD build/linuxbios.bootblock BUILD LAR BUILD LZMA HOSTCC build/util/lar/lar.o HOSTCC build/util/lar/create.o HOSTCC build/util/lar/extract.o HOSTCC build/util/lar/list.o HOSTCC build/util/lar/lib.o HOSTCC build/util/lar/bootblock.o HOSTCXX build/util/lzma/LZMAEncoder.o HOSTCXX build/util/lzma/LZInWindow.o HOSTCXX build/util/lzma/RangeCoderBit.o HOSTCXX build/util/lzma/StreamUtils.o HOSTCXX build/util/lzma/OutBuffer.o HOSTCXX build/util/lzma/Alloc.o HOSTCXX build/util/lzma/CRC.o HOSTCXX build/util/lar/lar HOSTCXX build/util/lzma/minilzma.o CC build/mainboard/emulation/qemu-x86/initram.o LD build/linuxbios.initram OBJCOPY build/linuxbios.initram CC build/lib/stage2.o CC build/lib/clog2.o CC build/lib/tables.o CC build/lib/compute_ip_checksum.o CC build/arch/x86/archtables.o /tmp/v3_fresh/arch/x86/archtables.c:43:2: warning: #warning enable disabled code in archtables.c /tmp/v3_fresh/arch/x86/archtables.c:133:2: warning: #warning GDT should be placed in a reserved position from the beginning on. CC build/arch/x86/linuxbios_table.o /tmp/v3_fresh/arch/x86/linuxbios_table.c: In function ‘lb_memory_range’: /tmp/v3_fresh/arch/x86/linuxbios_table.c:181: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ /tmp/v3_fresh/arch/x86/linuxbios_table.c:181: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 5 has type ‘unsigned int’ /tmp/v3_fresh/arch/x86/linuxbios_table.c: In function ‘lb_table_fini’: /tmp/v3_fresh/arch/x86/linuxbios_table.c:235: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 5 has type ‘u32’ CC build/arch/x86/pci_ops_auto.o CC build/arch/x86/pci_ops_conf1.o CC build/arch/x86/pci_ops_conf2.o CC build/arch/x86/keyboard.o CC build/arch/x86/i8259.o CC build/arch/x86/isa-dma.o CC build/device/device.o /tmp/v3_fresh/device/device.c: In function ‘find_constructor’: /tmp/v3_fresh/device/device.c:134: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 4 has type ‘struct constructor *’ /tmp/v3_fresh/device/device.c:137: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 4 has type ‘struct constructor *’ /tmp/v3_fresh/device/device.c: In function ‘constructor’: /tmp/v3_fresh/device/device.c:167: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 4 has type ‘struct constructor *’ /tmp/v3_fresh/device/device.c: In function ‘compute_allocate_resource’: /tmp/v3_fresh/device/device.c:496: warning: format ‘%02x’ expects type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ /tmp/v3_fresh/device/device.c:514:2: warning: #warning Modify allocate_vga_resource so it is less PCI centric. CC build/device/device_util.o /tmp/v3_fresh/device/device_util.c: In function ‘report_resource_stored’: /tmp/v3_fresh/device/device_util.c:608: warning: format ‘%02x’ expects type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ /tmp/v3_fresh/device/device_util.c: In function ‘search_global_resources’: /tmp/v3_fresh/device/device_util.c:646: warning: format ‘%x’ expects type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ /tmp/v3_fresh/device/device_util.c:646: warning: format ‘%x’ expects type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ /tmp/v3_fresh/device/device_util.c:661: warning: format ‘%x’ expects type ‘unsigned int’, but argument 6 has type ‘long unsigned int’ /tmp/v3_fresh/device/device_util.c:661: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 7 has type ‘unsigned int’ /tmp/v3_fresh/device/device_util.c:661: warning: format ‘%lx’ expects type ‘long unsigned int’, but argument 8 has type ‘unsigned int’ CC build/device/root_device.o CC build/device/pci_device.o /tmp/v3_fresh/device/pci_device.c: In function ‘pci_get_resource’: /tmp/v3_fresh/device/pci_device.c:214: warning: format ‘%02x’ expects type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ /tmp/v3_fresh/device/pci_device.c:214: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ /tmp/v3_fresh/device/pci_device.c: In function ‘pci_get_rom_resource’: /tmp/v3_fresh/device/pci_device.c:313: warning: format ‘%02x’ expects type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ /tmp/v3_fresh/device/pci_device.c:313: warning: format ‘%08x’ expects type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ /tmp/v3_fresh/device/pci_device.c: In function ‘pci_set_resource’: /tmp/v3_fresh/device/pci_device.c:461: warning: format ‘%02x’ expects type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ /tmp/v3_fresh/device/pci_device.c:541: warning: format ‘%x’ expects type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ CC build/device/pci_ops.o CC build/device/pci_rom.o /tmp/v3_fresh/device/pci_rom.c: In function ‘pci_rom_probe’: /tmp/v3_fresh/device/pci_rom.c:51: warning: format ‘%x’ expects type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ /tmp/v3_fresh/device/pci_rom.c: In function ‘pci_rom_load’: /tmp/v3_fresh/device/pci_rom.c:135: warning: format ‘%x’ expects type ‘unsigned int’, but argument 3 has type ‘struct rom_header *’ /tmp/v3_fresh/device/pci_rom.c:143: warning: format ‘%x’ expects type ‘unsigned int’, but argument 3 has type ‘struct rom_header *’ /tmp/v3_fresh/device/pci_rom.c:143: warning: format ‘%x’ expects type ‘unsigned int’, but argument 4 has type ‘void *’ CC build/device/pnp_device.o /tmp/v3_fresh/device/pnp_device.c: In function ‘pnp_set_resource’: /tmp/v3_fresh/device/pnp_device.c:92: warning: format ‘%02x’ expects type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ /tmp/v3_fresh/device/pnp_device.c:105: warning: format ‘%02x’ expects type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ CC build/device/pnp_raw.o CC build/mainboard/emulation/qemu-x86/vga.o HOSTCC build/util/dtc/dtc.o HOSTCC build/util/dtc/livetree.o HOSTCC build/util/dtc/flattree.o HOSTCC build/util/dtc/data.o HOSTCC build/util/dtc/treesource.o HOSTCC build/util/dtc/fstree.o BISON build/util/dtc/dtc-parser.tab.c HOSTCC build/util/dtc/dtc-parser.tab.o HOSTCC build/util/dtc/dtc DTC build/statictree.h DTC mainboard/emulation/qemu-x86/dts (dts->lbh) DTC build/mainboard/emulation/qemu-x86/statictree.c DTC mainboard/emulation/qemu-x86/dts (dts->lb) CC build/mainboard/emulation/qemu-x86/statictree.o CC build/northbridge/intel/i440bxemulation/i440bx.o /tmp/v3_fresh/northbridge/intel/i440bxemulation/i440bx.c: In function ‘ram_resource’: /tmp/v3_fresh/northbridge/intel/i440bxemulation/i440bx.c:83: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘resource_t’ CC build/southbridge/intel/i82371eb/i82371eb.o CC build/superio/winbond/w83627hf/superio.o /tmp/v3_fresh/superio/winbond/w83627hf/superio.c:73:2: warning: #warning Fix CMOS handling /tmp/v3_fresh/superio/winbond/w83627hf/superio.c: In function ‘init_hwm’: /tmp/v3_fresh/superio/winbond/w83627hf/superio.c:110: warning: format ‘%04x’ expects type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ /tmp/v3_fresh/superio/winbond/w83627hf/superio.c:134:2: warning: #warning init_uart8250 /tmp/v3_fresh/superio/winbond/w83627hf/superio.c:139:2: warning: #warning init_uart8250 CC build/util/x86emu/vm86.o /tmp/v3_fresh/util/x86emu/vm86.c:334:2: warning: #warning fix rom address /tmp/v3_fresh/util/x86emu/vm86.c:343:2: warning: #warning Implement write_protect_vgabios() /tmp/v3_fresh/util/x86emu/vm86.c: In function ‘biosint’: /tmp/v3_fresh/util/x86emu/vm86.c:547: warning: format ‘%x’ expects type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ /tmp/v3_fresh/util/x86emu/vm86.c:547: warning: format ‘%x’ expects type ‘unsigned int’, but argument 4 has type ‘long unsigned int’ /tmp/v3_fresh/util/x86emu/vm86.c:547: warning: format ‘%x’ expects type ‘unsigned int’, but argument 5 has type ‘long unsigned int’ /tmp/v3_fresh/util/x86emu/vm86.c:553: warning: format ‘%u’ expects type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ /tmp/v3_fresh/util/x86emu/vm86.c:582: warning: format ‘%x’ expects type ‘unsigned int’, but argument 3 has type ‘long unsigned int’ AR build/util/x86emu/libx86emu.a LD build/linuxbios.stage2 OBJCOPY build/linuxbios.stage2 HOSTCC build/util/options/build_opt_tbl.o HOSTCC build/util/options/build_opt_tbl OPTIONS build/mainboard/emulation/qemu-x86/option_table.c CC build/mainboard/emulation/qemu-x86/option_table.o OBJCOPY build/option_table PAYLOAD none (as specified by user) LAR build/linuxbios.rom CP build/bios.bin DONE
Uwe.
* Uwe Hermann uwe@hermann-uwe.de [070723 11:57]:
This is causing quite a bunch of additional warnings, see below:
Yes, that's why I finally checked it in. The code was problematic before, just did not warn.
Most, if not all of them need fixing (some were not only casting problems but explicitly wrong parameters such as a forgotten string after a %s)