Article View: comp.std.c
Article #196Re: min, max, and ANSI
From: Pete Becker
Date: Fri, 10 Apr 1992 16:23
Date: Fri, 10 Apr 1992 16:23
15 lines
1162 bytes
1162 bytes
In article <1992Apr9.165859.18578@wam.umd.edu> krc@wam.umd.edu (Kevin R. Coombes) writes: >I have a question about the ANSI C header stdlib.h. A certain compiler that >shall for the moment remain nameless includes macros for min(a,b) and >max(a,b) in <stdlib.h>. Consequently, I managed to lose several hours >trying to find out why a working program suddenly broke---eventually >discovering, of course, that I had been using min as the name of a variable, >and had changed things hwen I #included <stdlib.h> for unrelated reasons. >Are min and max SUPPOSED to be in stdlib.h, and have I been just lucky >in avoiding this problem in the past? > >Kevin Coombes <krc@math.umd.edu> If you compile in ANSI mode (with the -A switch), min and max go away. They also go away when compiling C++. -- Pete
Technical Details
Message-ID:
<1992Apr10.162327.29202@borland.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!mips!decwrl!borland.com!peteReferences:
<1992Apr9.165859.18578@wam.umd.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c,comp.std.c++ Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!mips!decwrl!borland.com!pete From: pete@borland.com (Pete Becker) Subject: Re: min, max, and ANSI Message-ID: <1992Apr10.162327.29202@borland.com> Organization: Borland International References: <1992Apr9.165859.18578@wam.umd.edu> Date: Fri, 10 Apr 1992 16:23:27 GMT