Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!bbn!gatech!hubcap!rchampe From: rchampe@hubcap.UUCP (Richard Champeaux) Newsgroups: comp.sys.amiga Subject: Re: Aztec C bug Message-ID: <691@hubcap.UUCP> Date: Thu, 19-Nov-87 12:53:45 EST Article-I.D.: hubcap.691 Posted: Thu Nov 19 12:53:45 1987 Date-Received: Sun, 22-Nov-87 02:23:29 EST References: <532@oscvax.UUCP> Distribution: na Organization: Clemson University, Clemson, SC Lines: 30 Summary: Is that legal to begin with? In article <532@oscvax.UUCP>, rico@oscvax.UUCP (Rico Mariani) writes: > > main() > { > struct foo { int x; } bar; > > if (bar) ; > } > > compiles to: > > ; if (bar) ; > tst.r -2(a5) <----- Say what? what's a .r??? > beq .4 I'm not an expert in C, but doesn't "if (bar)" mean "if (bar!=0)" and its illegal to compare a structure to an integer even if the structure is only an integer, (I could be wrong, like I said, I'm no expert.) If I remember right, using a structure name alone does not give a pointer to that structure like using the unsubscripted name of an array would. To get a pointer to the structure bar, you would use &bar. (Once again, I could be wrong, I'm no expert.) Anyways, a simmilar thing happened to me a while back, I don't remember the exact code but it had to do with structures and pointers. I got a move.x instead. I think it's less of a bug, and more of a very poor way to point out errors. Rich Champeaux Clemson University