Re: why does this code generate a[n incorrect] error?
Re: why does this code generate a[n incorrect] error?
- Subject: Re: why does this code generate a[n incorrect] error?
- From: Markian Hlynka <email@hidden>
- Date: Wed, 16 Jun 2004 16:30:46 -0600
On Jun 16, 2004, at 15:51, Justin Walker wrote:
Please don't cross-post.
sorry! I really didn't know where to post; both lists seemed pertinent.
:(
apologies all around.
On Jun 16, 2004, at 14:26, Markian Hlynka wrote:
extern int STOP;
#define EQUALS ==
if(STOP EQUAL 1)
{
do something
}
It would help if we actually had the code in question, but there are
two problems with this:
1) EQUALS != EQUAL
that's the real bug. the one the compiler isn't catching.
2) as a standalone fragment, this isn't well-formed
(you can't have executable statements outside a
procedure)
yes; I was trying to make an example of what was happening, and
described it poorly.
It should have been:
----------------------------
file a.h:
int STOP;
----------------------------
file b.h:
#define EQUALS ==
extern int STOP
myfunc()
{
if(STOP EQUAL 1) //here is a bug, EQUAL is wrong.
//but that's not where the compiler is calling the bug
{
//do something
}
}
----------------------------
the bug from the compiler is that STOP is undeclared. which it is,
because when I correct EQUAL to EQUALS, it all works fine.
Markian
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.