#ifdef __STDC__

Tim Wickberg me at k9mach3.org
Thu Jun 3 20:47:48 PDT 2004


I've run into a number of places where the code is broken with 
conditionals testing for whether to build in K&R or ANSI style.

example, from usr.bin/xlint/lint1/err.c

	void
	#ifdef __STDC__
	message(int n, ...)
	#else
	message(n, va_alist)
		int	n;
		va_dcl
	#endif
	{
At this point, I'm assuming we'll never be compiling without __STDC__, 
and that places where this show up can be cut down to that one case... 
I'm just looking for some verification on this.

On a similar strain, there're some files that were written to be 
cross-bsd, with conditionals testing for [Open,Net,Free]BSD[i] and 
versions thereof. Is it okay to reduce these as well, since i can't see 
any reason why these files would be dragged over?

example, from sys/net/bpf.c

	/*
	 * Support for SunOS, which does not have tsleep.
	 */
	#if BSD < 199103
	static
	bpf_timeout(arg)
	        caddr_t arg;
	{


Thanks,
Tim Wickberg
me at xxxxxxxxxxx




More information about the Kernel mailing list