f



error: macro "check" passed 3 arguments, but takes just 1

Hello!
I have a problem with porting to XCode.
In CW code compiles well. But in XCode I've got the following:

error: macro "check" passed 3 arguments, but takes just 1

In code "check" is a macro, and virtual member of class.
Build fail on class member declaration "chak" with this message.

0
Fonarix
10/24/2006 7:22:14 AM
comp.sys.mac.programmer.help 4653 articles. 2 followers. Post Follow

2 Replies
2214 Views

Similar Articles

[PageSpeed] 12

Fonarix <fonarix@ukr.net> wrote:
> 
> Hello!
> I have a problem with porting to XCode.
> In CW code compiles well. But in XCode I've got the following:
> 
> error: macro "check" passed 3 arguments, but takes just 1
> 
> In code "check" is a macro, and virtual member of class.
> Build fail on class member declaration "chak" with this message.

That's a really bad idea. Macros get applied long before the compiler 
itself sees anything, and therefore aren't subject to namespaces. This 
means that macros *must* be unique relative to basically everything else 
in the areas where they are visible. If both the macro and the virtual 
member are visible in the same place, then you must rename one of them.

This is why you usually see macro names in all caps, as it won't interfere 
with other normally-named identifiers. Following this idea, you should 
rename your macro to CHECK so it no longer conflicts with the virtual 
member.

-- 
Michael Ash
Rogue Amoeba Software
0
Michael
10/24/2006 12:16:42 PM
Michael Ash wrote:
> Fonarix <fonarix@ukr.net> wrote:
> >
> > Hello!
> > I have a problem with porting to XCode.
> > In CW code compiles well. But in XCode I've got the following:
> >
> > error: macro "check" passed 3 arguments, but takes just 1
> >
> > In code "check" is a macro, and virtual member of class.
> > Build fail on class member declaration "chak" with this message.
>
> That's a really bad idea. Macros get applied long before the compiler
> itself sees anything, and therefore aren't subject to namespaces. This
> means that macros *must* be unique relative to basically everything else
> in the areas where they are visible. If both the macro and the virtual
> member are visible in the same place, then you must rename one of them.
>
> This is why you usually see macro names in all caps, as it won't interfere
> with other normally-named identifiers. Following this idea, you should
> rename your macro to CHECK so it no longer conflicts with the virtual
> member.
>
> --
> Michael Ash
> Rogue Amoeba Software

Thanks for reply!
I've done #undef badmakros  )))

0
Fonarix
10/25/2006 3:29:54 PM
Reply: