Subject: Kernel printf cleanup proposal
To: None <>
From: Todd Vierling <>
List: tech-kern
Date: 07/28/2000 11:52:57
In order to rid the kernel of the nasty "KPRINTF_ATTRIBUTE" hack, I need to
eliminate the nonstandard formatting characters supported by kprintf.  I
would like to do the following:

- convert all uses of %b to appropriate bitmask_snprintf() calls, which
  is already used by some code

- remove the flags %z, %r, %n (no longer used by ddb), and %: (no longer
  used after I removed the only two instances from sys/arch/atari/dev)

Additionally, I'd like to migrate uses of [v]sprintf() to [v]snprintf(),
requiring that the buffer size always be given, and remove the non-sized
calls completely.  This would enforce somewhat better programming within the
kernel, preventing buffer overflows (as long as the correct buffer size is
given 8^).

These changes will induce a version-letter bump, since third-party kernel
source may make use of the old formatting characters and/or [v]sprintf().


-- Todd Vierling (