[BusyBox] const type

Mark Whitley markw at lineo.com
Mon Apr 9 18:05:48 UTC 2001


On Sun, Apr 01, 2001 at 06:05:56PM +1000, Glenn McGrath wrote:
> There are at least a few variables that could be declared as const.
> 
> Declaring a variable as const doesnt seem to make any difference in
> size, so is the point to declaring const purley to help debugging ?

Quoting from the style guide:

	Declaring variables as '[static] const' gives variables an actual type and
	makes the compiler do type checking for you; the preprocessor does _no_
	type checking whatsoever, making it much more error prone. Declaring
	variables with '[static] const' also makes debugging programs much easier
	since the value of the variable can be easily queried and displayed.

HTH

Mark Whitley
markw at lineo.com





More information about the busybox mailing list