Subject: g++ 3.2 doesn't like "#define and"

From: "Zachariah P. Garner" <[email-masked]>
Date: Sun, 2 Feb 2003 23:15:04 -0600

I get the following errors when using gcc 3.2.1 when compiling some
C++ code that includes c-client.h:

| /usr/local/include/c-client/c-client.h:27:9: "and" cannot be used as a macro
| name as it is an operator in C++
| /usr/local/include/c-client/c-client.h:28:9: "or" cannot be used as a macro
| name as it is an operator in C++
| /usr/local/include/c-client/c-client.h:29:9: "not" cannot be used as a macro
| name as it is an operator in C++

Does anyone know a work-around for this? (aside from the obvious solution of
not using C++, not using gcc 3.2 or not using c-client)

Thanks,
Zach Garner
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Vadim Zeitlin <[email-masked]>
Date: Mon, 3 Feb 2003 10:34:17 +0100 (Romance Standard Time)

On Sun, 2 Feb 2003 23:15:04 -0600 "Zachariah P. Garner" <[email-masked]> wrote:

ZPG> I get the following errors when using gcc 3.2.1 when compiling some
ZPG> C++ code that includes c-client.h:
ZPG> 
ZPG> | /usr/local/include/c-client/c-client.h:27:9: "and" cannot be used as a macro
ZPG> | name as it is an operator in C++
ZPG> | /usr/local/include/c-client/c-client.h:28:9: "or" cannot be used as a macro
ZPG> | name as it is an operator in C++
ZPG> | /usr/local/include/c-client/c-client.h:29:9: "not" cannot be used as a macro
ZPG> | name as it is an operator in C++
ZPG> 
ZPG> Does anyone know a work-around for this? (aside from the obvious solution of
ZPG> not using C++, not using gcc 3.2 or not using c-client)

 With gcc the simplest solution is to use -fno-operator-names.
Unfortunately it is known to not work with some gcc versions. I have a big
section in configure which tries to work around this mess -- with some
success although I'm sure there are compilers with which it still doesn't
work. Contact me in private if you want to have a look at it.

 Regards,
VZ