Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site burl.UUCP Path: utzoo!watmath!clyde!burl!rcj From: rcj@burl.UUCP (R. Curtis Jackson) Newsgroups: net.lang.c Subject: structure == structure Message-ID: <401@burl.UUCP> Date: Mon, 30-Jan-84 15:36:46 EST Article-I.D.: burl.401 Posted: Mon Jan 30 15:36:46 1984 Date-Received: Sun, 5-Feb-84 10:58:13 EST Organization: Western Electric, Burlington, NC Lines: 58 Here's the program /* VERY simple */ : ------------------------------------------------------------ # includetypedef struct { unsigned w1 : 1, w2 : 1, numreg : 1, as : 1, sd : 1, sp : 1, error : 1; } FLAGS ; typedef struct { char *sval; long lval; short tok; char cval; FLAGS flags; } YYSTYPE ; main() { YYSTYPE a,b; a.flags.w1 = 1; b.flags.w1 = 1; if (a.flags == b.flags) printf("first test\n"); a.flags.sd = 1; if (a.flags == b.flags) printf("second test\n"); } ------------------------------------------------------------ Here's the output from cc(1) -- (USG 5.0): ------------------------------------------------------------ "seqt.c", line 27: operands of == have incompatible types "seqt.c", line 30: operands of == have incompatible types ------------------------------------------------------------ Here's the question: Can one not compare structures at all, is this just some flaky use of structure comparisons that is not allowed, or did I just plain screw up /* or all of the above */? Replies by mail or telephone ONLY, please, both to keep down net traffic and because I don't read net.lang.c anymore. Thanks very much for any time spent in helping this deranged person, -- The MAD Programmer -- 919-228-3313 (Cornet 291) alias: Curtis Jackson ...![ floyd clyde ihnp4 mhuxv ]!burl!rcj