From: Bill Ahlbrandt <bahlbr@icdata.com>
To: "'egcs@cygnus.com'" <egcs@cygnus.com>
Subject: min/max macros
Date: Thu, 11 Dec 1997 09:17:00 -0000 [thread overview]
Message-ID: <01BD0625.FDFCC640@bill.icdata.com> (raw)
I have noticed that these macros are not always available and not always in the same place.
Specifically, with egcs, they seem to be in curses.h
I "coded" my own and used them as follows:
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
After discovering that max in particular was not yielding the desired results, I coded these macros as functions. All of my problems went away.
Is it generally a bad plan to use macros like this? Are there any known problems with egcs involving macros such as these?
Thanks in advance..
next reply other threads:[~1997-12-11 9:17 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-12-11 9:17 Bill Ahlbrandt [this message]
1997-12-11 13:03 ` Michael A. Benzinger
1997-12-11 13:03 ` dave madden
1997-12-11 13:43 ` [EGCS] " Marc Lehmann
1997-12-11 13:43 ` Gerald Pfeifer
1997-12-11 17:57 ` [EGCS] " Marc Lehmann
1997-12-11 19:51 ` Joe Buck
1997-12-12 10:18 ` Marc Lehmann
1997-12-12 7:51 ` Paul Koning
1997-12-11 19:02 Mike Stump
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=01BD0625.FDFCC640@bill.icdata.com \
--to=bahlbr@icdata.com \
--cc=egcs@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).