Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: ! operator in constant expressions Message-ID: <7027@brl-smoke.ARPA> Date: 11 Jan 88 08:06:11 GMT References: <3813@hoptoad.uucp> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 17 In article <3813@hoptoad.uucp> gnu@hoptoad.uucp (John Gilmore) writes: >I just wrote an interesting test program for ! and haven't yet found >a compiler that correctly implements the draft ANSI standard for it. >int install = !0; >char foo = !1; I left the draft standard in my other trousers, but I'm sure that the above two should work, with values 1 and 0 in that order. >int bar = !3.14156; >int pno = ! &bar; >int pyes = !(char *)0; I don't see how you could expect any of these three to work; the operand of ! has to be an integer, which might be obtained by promotion but never by demotion or assumed type conversion of pointers.