Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2002 11:07:52 -0800
From:      Bill Fenner <fenner@research.att.com>
To:        julian@elischer.org
Cc:        cvs-committers@freebsd.org, cvs-all@freebsd.org
Subject:   Re: cvs commit: src/sys/dev/usb ohci.c uhci.c
Message-ID:  <200202271907.LAA08891@windsor.research.att.com>

next in thread | raw e-mail | index | archive | help

>maybe a comment may stall that..

This is a relatively harmless instance;

	/* this should be for(x;y;z) except gcc sucks */

but what about when it requires completely rearchitecting the code
to silence the buggy compiler?  I wish I could find this example, but
I only noted it and said "ugh" and moved on -- when comparing our code
with that of another project, they had completely rewritten some very
straightforward code that looked more or less like:

	switch (x) {
	case foo:
		fmt = "%s foo";
		break;
	case bar:
		fmt = "%s bar";
		break;
	}
	printf(fmt, bletch);

(but many more cases and many more printf arguments) to include the
printf in every case -- presumably to avoid warnings from a mechanical
tool that "knew" that any non-constant format string was an opening
for format string vulnerabilities.  That change opened up lots of
opportunities for cut'n'paste errors, maintenance problems if you wanted
to change the printf argument list, etc -- for what benefit?

I think asmodai said it quite succinctly:

"compilers and related tools should facilitate the programming, the
programming should not facilitate the compiler and tools."

  Bill

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202271907.LAA08891>