Mon, May 14, 2001 at 00:17:31, dima (Dima Dorfman) wrote about "MIN()/MAX() 
definitions in sys/param.h": 

> Is there a reason the definitions of the MIN() and MAX() macros in
> sys/param.h are under an '#ifndef _KERNEL'?  Quite a few files in the
> kernel define these (well, at least MIN) themselves, so it would seem
> to make sense to define them globally in sys/param.h for the kernel as
> well.  Any reason this isn't already done this way, or should I come
> up with a patch to fix that?

gcc provides safe way to implement min()/max():

=== cut from info gcc ===
     #define max(a,b) \
       ({typedef _ta = (a), _tb = (b);  \
         _ta _a = (a); _tb _b = (b);     \
         _a > _b ? _a : _b; })
=== end cut ===

For kernel compiling you may rely on gcc and use such safe macros.
I'm unsure for the same statement about userland.


/netch

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to