Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!hplabs!sri-unix!buck@NRL-CSS.ARPA From: buck@NRL-CSS.ARPA Newsgroups: net.lang.c Subject: expressions and #if Message-ID: <1870@sri-arpa.UUCP> Date: Wed, 11-Jul-84 13:48:37 EDT Article-I.D.: sri-arpa.1870 Posted: Wed Jul 11 13:48:37 1984 Date-Received: Sun, 15-Jul-84 09:59:30 EDT Lines: 25 From: Joe Buck A look at the yacc grammar for cpp on 4.1bsd shows that yes, the !, &&, and || operators are supported. The c preprocessor for 4.1bsd knows about the following operators: * / % + - << >> < > >= <= == != & ^ | && || ?: , UMINUS ! defined where UMINUS is the unary minus. "defined" is handled as an operator, not a macro; defined(foo) returns 1 if foo is defined and zero otherwise. As an operator, it is only evaluated on lines beginning with "#". Apparently, "defined foo" is equivalent to "defined(foo)". Once it's decided that any cpp must support some of the unary and binary operators, the extra work to include others is trivial, so it seems to me that the K&R listing of legal operators was an error on their part. "defined", on the other hand, I don't know about. ARPA: buck@nrl-css.ARPA UUCP: ...!{decvax,linus,umcp-cs}!nrl-css!buck -Joe