Skip to contentSkip to conversation

2.4.9 does not compile

DISCUSSION Adam J. Richter 2 participants 2 messages Aug 17, 2001

lore
Share & tools
lore
#0 lore raw

The macro "min(n1,n2)", is a very standard practice in C
programming. Having a different version of "min" adds unnecessary porting work and ifdef clutter when code is port between the kernel and other uses (typically small mathematical calculations, data structure manipulations, and data stream tranformations like compression and encryption, such as in freeswan, which I had to modify).

If a programmer wants to explicitly specify which type the
comparison converts to, then he or she can cast the arguments explicitly. Programmers already have the opportunity "to think about it." Impeding programming just to make programmers "think about it" rather than treating their time as precious and letting them determine how to invest it is rarely a winning trade-off, especially when you also weigh the quality effects of increased code clutter and less programmer time available for other improvements. To call this change Pascal-like would be an insult to Pascal.

If you really want this facility, you could just declare
a distinct "typed_min" macro.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
[email protected]     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America

fax +1 408 261-6631 "Free Software For The Rest Of Us."

#1 lore raw

From: "Adam J. Richter" <[email protected]>
Date: Thu, 16 Aug 2001 22:03:07 -0700

The macro "min(n1,n2)", is a very standard practice in C
programming.

If min() in it's "very standard practice" form is broken at the core, breaking it like I have is a fix.

Let this go till Linus returns from Finland in a week or so, I'm sure he'll be more than happy to state why he wanted me to do these changes.

Later,
David S. Miller
[email protected]