linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* min() and max() in kernel.h ?
@ 2001-08-17 19:13 Herbert Rosmanith
  2001-08-17 19:21 ` Michael H. Warfield
  2001-08-17 21:52 ` Ingo Oeser
  0 siblings, 2 replies; 5+ messages in thread
From: Herbert Rosmanith @ 2001-08-17 19:13 UTC (permalink / raw)
  To: linux-kernel


hi,

just now I tried to compile some module and noticed that it doesnt
compile anymore because "macro min used with only two arguments".
I had some "#define min(a,b) (a<b?a:b)" myself.

I then found min() being defined in <linux/kernel.h> with an additional
type argument and some superfluos (imo) assignment code. Erm. What's going
next, drawing elipses in kernel?

I'm also missing some comment who added min/max to kernel.h, at least
I want to know who I am going to flame :->

/herp


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

* Re: min() and max() in kernel.h ?
  2001-08-17 19:13 min() and max() in kernel.h ? Herbert Rosmanith
@ 2001-08-17 19:21 ` Michael H. Warfield
  2001-08-17 19:26   ` Jeff Golds
  2001-08-17 19:29   ` Hua Zhong
  2001-08-17 21:52 ` Ingo Oeser
  1 sibling, 2 replies; 5+ messages in thread
From: Michael H. Warfield @ 2001-08-17 19:21 UTC (permalink / raw)
  To: Herbert Rosmanith; +Cc: linux-kernel

On Fri, Aug 17, 2001 at 09:13:20PM +0200, Herbert Rosmanith wrote:

> hi,

> just now I tried to compile some module and noticed that it doesnt
> compile anymore because "macro min used with only two arguments".
> I had some "#define min(a,b) (a<b?a:b)" myself.

> I then found min() being defined in <linux/kernel.h> with an additional
> type argument and some superfluos (imo) assignment code. Erm. What's going
> next, drawing elipses in kernel?

> I'm also missing some comment who added min/max to kernel.h, at least
> I want to know who I am going to flame :->

	Please review the flamefest threads in this forum going under the
subjects of "2.4.9 does not compile" and related "[PATCH]".  That will
answer who what when and why, as well as giving you a suitable case of
characters to throw stones, or whatever else is handy, at.

	Rather interesting that Linus ducked out of town just in time
for this...  :->

> /herp

	Mike
-- 
 Michael H. Warfield    |  (770) 985-6132   |  mhw@WittsEnd.com
  (The Mad Wizard)      |  (678) 463-0932   |  http://www.wittsend.com/mhw/
  NIC whois:  MHW9      |  An optimist believes we live in the best of all
 PGP Key: 0xDF1DD471    |  possible worlds.  A pessimist is sure of it!


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

* Re: min() and max() in kernel.h ?
  2001-08-17 19:21 ` Michael H. Warfield
@ 2001-08-17 19:26   ` Jeff Golds
  2001-08-17 19:29   ` Hua Zhong
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Golds @ 2001-08-17 19:26 UTC (permalink / raw)
  To: Michael H. Warfield; +Cc: Herbert Rosmanith, linux-kernel

"Michael H. Warfield" wrote:
> 
>         Please review the flamefest threads in this forum going under the
> subjects of "2.4.9 does not compile" and related "[PATCH]".  That will
> answer who what when and why, as well as giving you a suitable case of
> characters to throw stones, or whatever else is handy, at.
> 
>         Rather interesting that Linus ducked out of town just in time
> for this...  :->
> 

Now we can make this into a conspiracy theory as well =)

> 
>         Mike

-Jeff

-- 
Jeff Golds
Sr. Software Engineer
jgolds@resilience.com

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

* Re: min() and max() in kernel.h ?
  2001-08-17 19:21 ` Michael H. Warfield
  2001-08-17 19:26   ` Jeff Golds
@ 2001-08-17 19:29   ` Hua Zhong
  1 sibling, 0 replies; 5+ messages in thread
From: Hua Zhong @ 2001-08-17 19:29 UTC (permalink / raw)
  To: Michael H. Warfield, Herbert Rosmanith; +Cc: linux-kernel

> On Fri, Aug 17, 2001 at 09:13:20PM +0200, Herbert Rosmanith wrote:
> Please review the flamefest threads in this forum going under the
> subjects of "2.4.9 does not compile" and related "[PATCH]".  That will
> answer who what when and why, as well as giving you a suitable case of
> characters to throw stones, or whatever else is handy, at.
>
> Rather interesting that Linus ducked out of town just in time
> for this...  :->

which is the reason why he is smarter than DaveM? :-)

> > /herp
>
> Mike
> --
>  Michael H. Warfield    |  (770) 985-6132   |  mhw@WittsEnd.com
>   (The Mad Wizard)      |  (678) 463-0932   |
http://www.wittsend.com/mhw/
>   NIC whois:  MHW9      |  An optimist believes we live in the best of all
>  PGP Key: 0xDF1DD471    |  possible worlds.  A pessimist is sure of it!
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


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

* Re: min() and max() in kernel.h ?
  2001-08-17 19:13 min() and max() in kernel.h ? Herbert Rosmanith
  2001-08-17 19:21 ` Michael H. Warfield
@ 2001-08-17 21:52 ` Ingo Oeser
  1 sibling, 0 replies; 5+ messages in thread
From: Ingo Oeser @ 2001-08-17 21:52 UTC (permalink / raw)
  To: linux-kernel

On Fri, Aug 17, 2001 at 09:13:20PM +0200, Herbert Rosmanith wrote:
> I then found min() being defined in <linux/kernel.h> with an additional
> type argument and some superfluos (imo) assignment code. Erm. What's going
> next, drawing elipses in kernel?
 
The assignment is needed to avoid side effects. Only the
type-argument is discussable. But it is needed due to constants
and sign issues. Details are in the archive.

But I didn't add it, I just understand the reasoning of it an
its implementation.

Regards

Ingo Oeser
-- 
In der Wunschphantasie vieler Mann-Typen [ist die Frau] unsigned und
operatorvertraeglich. --- Dietz Proepper in dasr

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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-17 19:13 min() and max() in kernel.h ? Herbert Rosmanith
2001-08-17 19:21 ` Michael H. Warfield
2001-08-17 19:26   ` Jeff Golds
2001-08-17 19:29   ` Hua Zhong
2001-08-17 21:52 ` Ingo Oeser

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