Removing -Wno-format from kernel makefiles, 06/16

2013-07-04 Thread Stefan Fritsch
Use %z* for size_t while there, fix a few %d into %u --- sys/arch/i386/pci/pcibios.c |2 +- sys/dev/ic/bwi.c|4 ++-- sys/dev/ic/pgt.c|6 +++--- sys/dev/ic/ti.c |4 ++-- sys/dev/pci/amdiic.c|4 ++-- sys/dev/pci/amdpm.c |

Re: Removing -Wno-format from kernel makefiles, 3/16

2013-07-04 Thread Stefan Fritsch
On Wed, 3 Jul 2013, Mark Kettenis wrote: diff --git sys/arch/i386/i386/db_interface.c sys/arch/i386/i386/db_interface.c index 85c1ff5..c75fd89 100644 --- sys/arch/i386/i386/db_interface.c +++ sys/arch/i386/i386/db_interface.c @@ -197,11 +197,11 @@ db_sysregs_cmd(db_expr_t addr, int

Re: Removing -Wno-format from kernel makefiles, 4/16

2013-07-04 Thread Stefan Fritsch
On Wed, 3 Jul 2013, Mark Kettenis wrote: diff --git sys/arch/i386/i386/esm.c sys/arch/i386/i386/esm.c index c90b2c4..3dff69e 100644 --- sys/arch/i386/i386/esm.c +++ sys/arch/i386/i386/esm.c @@ -880,7 +880,7 @@ esm_make_sensors(struct esm_softc *sc, struct esm_devmap *devmap,

Removing -Wno-format from kernel makefiles, 07/16

2013-07-04 Thread Stefan Fritsch
fix: %x instead of %p for int --- sys/dev/pci/musycc_obsd.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git sys/dev/pci/musycc_obsd.c sys/dev/pci/musycc_obsd.c index 25a58d8..0844136 100644 --- sys/dev/pci/musycc_obsd.c +++ sys/dev/pci/musycc_obsd.c @@ -215,7 +215,7 @@

Removing -Wno-format from kernel makefiles, 10/16

2013-07-04 Thread Stefan Fritsch
fix: pointer to long --- sys/arch/i386/pci/pci_addr_fixup.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git sys/arch/i386/pci/pci_addr_fixup.c sys/arch/i386/pci/pci_addr_fixup.c index 59880eb..40f7918 100644 --- sys/arch/i386/pci/pci_addr_fixup.c +++

Removing -Wno-format from kernel makefiles, 08/16

2013-07-04 Thread Stefan Fritsch
%hu/%hd for uint16_t, %u/%d/%x for uint32_t despite the name, ntohl returns uint32_t also fix some %d into %u --- sys/arch/i386/i386/bios.c|4 ++-- sys/arch/i386/i386/ioapic.c |2 +- sys/arch/i386/pci/pcibios.c |4 ++-- sys/kern/vfs_cluster.c |2 +-

Re: Removing -Wno-format from kernel makefiles, V2

2013-07-04 Thread Stefan Fritsch
On Wednesday 03 July 2013, Stefan Fritsch wrote: I haven't done any signedness fixes so far, only the size fixes. But I will look over the patches again and try to fix the signedness issues in the touched code lines, too. There are quite a few I guess. For people prefering to review by source

Re: Removing -Wno-format from kernel makefiles, 07/16

2013-07-04 Thread Franco Fichtner
On Jul 4, 2013, at 6:43 PM, Stefan Fritsch s...@sfritsch.de wrote: fix: %x instead of %p for int --- sys/dev/pci/musycc_obsd.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git sys/dev/pci/musycc_obsd.c sys/dev/pci/musycc_obsd.c index 25a58d8..0844136 100644 ---

Re: Removing -Wno-format from kernel makefiles, 3/16

2013-07-04 Thread Mark Kettenis
Date: Thu, 4 Jul 2013 18:41:30 +0200 (CEST) From: Stefan Fritsch s...@sfritsch.de On Wed, 3 Jul 2013, Mark Kettenis wrote: diff --git sys/arch/i386/i386/db_interface.c sys/arch/i386/i386/db_interface.c index 85c1ff5..c75fd89 100644 --- sys/arch/i386/i386/db_interface.c +++

Re: Removing -Wno-format from kernel makefiles, 4/16

2013-07-04 Thread Mark Kettenis
Date: Thu, 4 Jul 2013 18:42:50 +0200 (CEST) From: Stefan Fritsch s...@sfritsch.de On Wed, 3 Jul 2013, Mark Kettenis wrote: diff --git sys/arch/i386/i386/esm.c sys/arch/i386/i386/esm.c index c90b2c4..3dff69e 100644 --- sys/arch/i386/i386/esm.c +++ sys/arch/i386/i386/esm.c @@

Re: Removing -Wno-format from kernel makefiles, 06/16

2013-07-04 Thread Alexander Bluhm
On Thu, Jul 04, 2013 at 06:39:03PM +0200, Stefan Fritsch wrote: diff --git sys/netinet/ip_output.c sys/netinet/ip_output.c index b59accf..43a0551 100644 --- sys/netinet/ip_output.c +++ sys/netinet/ip_output.c @@ -267,7 +267,7 @@ reroute: if (mtag != NULL) { #ifdef DIAGNOSTIC

Removing -Wno-format from kernel makefiles, 1/16

2013-07-03 Thread Stefan Fritsch
add support for %td for ptrdiff_t in kernel this also adds support in gcc 4.x kprintf --- gnu/gcc/gcc/c-format.c |7 --- sys/kern/subr_prf.c|6 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git gnu/gcc/gcc/c-format.c gnu/gcc/gcc/c-format.c index

Re: Removing -Wno-format from kernel makefiles, 1/16

2013-07-03 Thread Mark Kettenis
Date: Wed, 3 Jul 2013 16:35:24 +0200 (CEST) From: Stefan Fritsch s...@sfritsch.de add support for %td for ptrdiff_t in kernel this also adds support in gcc 4.x kprintf I'm on the fence about the CTASSERT here. If we ever support a code model that's not ILP32 or LP64, we need a major

Re: Removing -Wno-format from kernel makefiles, 2/16

2013-07-03 Thread Mark Kettenis
Date: Wed, 3 Jul 2013 16:40:17 +0200 (CEST) From: Stefan Fritsch s...@sfritsch.de don't pass empty format string in subr_disk.c this is necessary to enable -Wformat or -Wno-error=format Don't think this one makes much sense. Better to just do: log(pri, %s, ); and keep the rest of the

Re: Removing -Wno-format from kernel makefiles, 4/16

2013-07-03 Thread Mark Kettenis
Date: Wed, 3 Jul 2013 16:55:46 +0200 (CEST) From: Stefan Fritsch s...@sfritsch.de format string fixes: long --- sys/arch/i386/i386/esm.c |2 +- sys/kern/kern_descrip.c |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git sys/arch/i386/i386/esm.c

Re: Removing -Wno-format from kernel makefiles

2013-04-28 Thread Stefan Fritsch
On Sun, 21 Apr 2013, Stefan Fritsch wrote: On Sunday 21 April 2013, Philip Guenther wrote: Maybe this should be handled the bool bits in sys/types.h, wrapping them in #ifdef _KERNEL ? #ifdef _KERNEL is fine with me. OK for the patch below? --- a/gnu/gcc/gcc/c-format.c +++

Re: Removing -Wno-format from kernel makefiles

2013-04-28 Thread Mark Kettenis
Date: Sun, 28 Apr 2013 11:52:47 +0200 (CEST) From: Stefan Fritsch s...@sfritsch.de On Sun, 21 Apr 2013, Stefan Fritsch wrote: On Sunday 21 April 2013, Philip Guenther wrote: Maybe this should be handled the bool bits in sys/types.h, wrapping them in #ifdef _KERNEL ? #ifdef _KERNEL

Re: Removing -Wno-format from kernel makefiles

2013-04-28 Thread Stefan Fritsch
On Sun, 28 Apr 2013, Stefan Fritsch wrote: On Sun, 21 Apr 2013, Stefan Fritsch wrote: On Sunday 21 April 2013, Philip Guenther wrote: Maybe this should be handled the bool bits in sys/types.h, wrapping them in #ifdef _KERNEL ? #ifdef _KERNEL is fine with me. OK for the patch

Re: Removing -Wno-format from kernel makefiles

2013-04-21 Thread Mark Kettenis
Date: Sat, 20 Apr 2013 13:27:34 +0200 (CEST) From: Stefan Fritsch s...@sfritsch.de Adding ptrdiff_t to stdint.h is not strictly necessary, but I see no reason not to do it. sys/stdint.h is stdint.h and the C standard doesn't allow you to have ptrdiff_t in stdint.h

Re: Removing -Wno-format from kernel makefiles

2013-04-21 Thread Stefan Fritsch
Moved ptrdiff_t definition to types.h with proper guards. Assume ptrdiff_t is long in subr_prf.c OK? --- a/gnu/gcc/gcc/c-format.c +++ b/gnu/gcc/gcc/c-format.c @@ -325,6 +325,7 @@ static const format_length_info kprintf_length_specs[] = { l, FMT_LEN_l, STD_C89, ll, FMT_LEN_ll, STD_C9L },

Re: Removing -Wno-format from kernel makefiles

2013-04-21 Thread Mark Kettenis
Date: Sun, 21 Apr 2013 15:02:49 +0200 (CEST) From: Stefan Fritsch s...@sfritsch.de Moved ptrdiff_t definition to types.h with proper guards. Assume ptrdiff_t is long in subr_prf.c OK? No. --- a/sys/sys/types.h +++ b/sys/sys/types.h @@ -177,6 +177,11 @@ typedef __clockid_t

Re: Removing -Wno-format from kernel makefiles

2013-04-21 Thread Stefan Fritsch
On Sunday 21 April 2013, Mark Kettenis wrote: +++ b/sys/sys/types.h @@ -177,6 +177,11 @@ typedef__clockid_t clockid_t; typedef __size_tsize_t; #endif +#ifndef_PTRDIFF_T_DEFINED_ +#define_PTRDIFF_T_DEFINED_ +typedef__ptrdiff_t

Re: Removing -Wno-format from kernel makefiles

2013-04-21 Thread Philip Guenther
On Sun, Apr 21, 2013 at 12:15 PM, Stefan Fritsch s...@sfritsch.de wrote: On Sunday 21 April 2013, Mark Kettenis wrote: ... You can't put ptrdiff_t in sys/types.h either. Why not? POSIX only speaks about at least the following types in sys/types.h, so there is no reason why it may not define

Re: Removing -Wno-format from kernel makefiles

2013-04-21 Thread Stefan Fritsch
On Sunday 21 April 2013, Philip Guenther wrote: On Sun, Apr 21, 2013 at 12:15 PM, Stefan Fritsch s...@sfritsch.de wrote: On Sunday 21 April 2013, Mark Kettenis wrote: ... You can't put ptrdiff_t in sys/types.h either. Why not? POSIX only speaks about at least the following types in

Re: Removing -Wno-format from kernel makefiles

2013-04-20 Thread Stefan Fritsch
On Sun, 14 Apr 2013, Theo de Raadt wrote: Since the kernel's printf does not support %td for ptrdiff_t, I have used %ld instead. %zd would also work. Is there a preferred way? Or try to add %td support to kernel printf? The patch below seems to do the trick for gcc 4.2. I can't see that we

Re: Removing -Wno-format from kernel makefiles

2013-04-20 Thread Theo de Raadt
I can't see that we would add an arch where sizeof(ptrdiff_t) != sizeof(size_t). We run on I32LP64 and ILP32, therefore, it seems better to match 't' to some other LONG print block, like 'D'. size_t is an high-level abstraction, not a base type.

Re: Removing -Wno-format from kernel makefiles

2013-04-15 Thread Stefan Fritsch
On Sun, 14 Apr 2013, Theo de Raadt wrote: That wasn't clear from Miod's response. So the policy is to assume that char/short/int/long long are 8/16/32/64 bits and that intptr_t is long? We only run on C8S16I32L32P32 and C8S16I32L64P64 architectures. Short names ILP32 and I32LP64. The

Re: Removing -Wno-format from kernel makefiles

2013-04-15 Thread Theo de Raadt
Or LL128 ... But if such architectures come around, all kinds of things will need to be changed. This should not prevent anyone from documenting the current best practices. All kinds of things will need to be changed? Quite the understatement.

Re: Removing -Wno-format from kernel makefiles

2013-04-14 Thread Stefan Fritsch
On Saturday 06 April 2013, Stefan Fritsch wrote: That wasn't clear from Miod's response. So the policy is to assume that char/short/int/long long are 8/16/32/64 bits and that intptr_t is long? Should that be added to style(9), then? I assume that the lack of a response means yes. The

Re: Removing -Wno-format from kernel makefiles

2013-04-14 Thread Theo de Raadt
That wasn't clear from Miod's response. So the policy is to assume that char/short/int/long long are 8/16/32/64 bits and that intptr_t is long? We only run on C8S16I32L32P32 and C8S16I32L64P64 architectures. Short names ILP32 and I32LP64. The addition of any other sizing would require