linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: 2.4.9 does not compile
@ 2001-08-17  5:03 Adam J. Richter
  2001-08-17  6:12 ` David S. Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Adam J. Richter @ 2001-08-17  5:03 UTC (permalink / raw)
  To: davem, linux-kernel

	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
adam@yggdrasil.com     \ /                  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."

^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <no.id>]
* Re: 2.4.9 does not compile
@ 2001-08-17  6:52 Adam J. Richter
  0 siblings, 0 replies; 5+ messages in thread
From: Adam J. Richter @ 2001-08-17  6:52 UTC (permalink / raw)
  To: davem; +Cc: linux-kernel

>   	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.

	Granted, in some cases, I am in favor of the Linux kernel
being the innovator in violating some prevailing standards that I
regard as sufficientliy "broken at the core", like, say, the
popularity of really long variable names.  However, I think just about
nobody else in this discussion accepts the major premise of that
syllogism that min(n1,n2) is "broken to the core", at least not
to the degree that changing it that way 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.

	OK.

Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  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."

^ permalink raw reply	[flat|nested] 5+ messages in thread
* 2.4.9 does not compile
@ 2001-08-16 21:11 f5ibh
  0 siblings, 0 replies; 5+ messages in thread
From: f5ibh @ 2001-08-16 21:11 UTC (permalink / raw)
  To: linux-kernel

Hi !

I've the following error messages :

gcc -D__KERNEL__ -I/usr/src/kernel-sources-2.4.9/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=k6
-DMODULE -DMODVERSIONS -include
/usr/src/kernel-sources-2.4.9/include/linux/modversions.h
-DNTFS_VERSION=\"1.1.16\"   -c -o unistr.o unistr.c
unistr.c: In function `ntfs_collate_names':
unistr.c:99: warning: implicit declaration of function `min'
unistr.c:99: parse error before `unsigned'
unistr.c:99: parse error before `)'
unistr.c:97: warning: `c1' might be used uninitialized in this function
unistr.c: At top level:
unistr.c:118: parse error before `if'
unistr.c:123: warning: type defaults to `int' in declaration of `c1'
unistr.c:123: `name1' undeclared here (not in a function)
unistr.c:123: warning: data definition has no type or storage class
unistr.c:124: parse error before `if'
make[3]: *** [unistr.o] Erreur 1
make[3]: Leaving directory `/usr/src/kernel-sources-2.4.9/fs/ntfs'
make[2]: *** [_modsubdir_ntfs] Erreur 2
make[2]: Leaving directory `/usr/src/kernel-sources-2.4.9/fs'
make[1]: *** [_mod_fs] Erreur 2
make[1]: Leaving directory `/usr/src/kernel-sources-2.4.9'
make: *** [stamp-build] Erreur 2


gcc is :
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20010319 (Debian prerelease)

------
Regards
		Jean-Luc

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-08-17  8:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-17  5:03 2.4.9 does not compile Adam J. Richter
2001-08-17  6:12 ` David S. Miller
     [not found] <no.id>
2001-08-17  8:58 ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2001-08-17  6:52 Adam J. Richter
2001-08-16 21:11 f5ibh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).