[Bro-Dev] min() and max() problem in util.h

Gregor Maier gregor at icir.org
Wed Nov 24 07:51:18 PST 2010


> Or, I can just replace the min/max function with a macro. However, then
> the problem is, that the expression that's passed to min/max will be
> evaluated twice, which is a problem if it has side effects.....

GCC's typeof() extension can solve this, however, then we'd have
compiler dependent code :-(

(http://en.wikipedia.org/wiki/Typeof)

cu
Gregor
-- 
Gregor Maier                                             gregor at icir.org
Int. Computer Science Institute (ICSI)          gregor at icsi.berkeley.edu
1947 Center St., Ste. 600                    http://www.icir.org/gregor/
Berkeley, CA 94704
USA



More information about the bro-dev mailing list