Article View: comp.lang.objective-c
Article #401Re: Hole in preprocessor support of Obj-C?
From: Kresten Krab Thorup
Date: Thu, 17 Apr 1997 00:00
Date: Thu, 17 Apr 1997 00:00
28 lines
1912 bytes
1912 bytes
and errorString is an NSString*. The problem is that sometimes
I'd like to say
ERROR(ERRORTYPE1, [NSString stringWithFormat:@"foo : %@",
[self bar]])
so I can pass a string generated with printf-style formatting.
The problem is that the preprocessor chokes with something like :
/CashierPayment.m:209: macro `ISLogError' used with too many (3) args
apperantly concerned about the two commas, despite the fact that
one of them is, in reality, part of an expression that should (IMHO) be
treated as a single macro argument.
You can probably work around this problem by enclosing the second
argument to ERROR with a pair of parentheses:
ERROR(ERRORTYPE1, ( [NSString ... , ... ] ));
-- Kresten
_ _ ___ _ _ _ _ _
| | _ _ _ __ | |_ / _ \ _| | __ (_)_ _ _(_) __ __ _ _ _| | | _
| |/ | '_|_ \| ' / _ / ` ||_ \| | ' ' | | |_ \ |_ \| | | / ` | |/ |
| <| | / . | | | \__( (| / _ | | | | | |_/ _ / _ | | |( (| | <
|_|\_|_| \_,_|_,_/\___/\_,_\__,_|_|_|_|_|_(_)__,_\__,_\_,_(_)_,_|_|\_|
Technical Details
Message-ID:
<xz6d8rtpwaz.fsf@california.daimi.aau.dk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<5j117u$oe6@medusa.is.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,30fc78d511a0d982 X-Google-Attributes: gid11318c,public X-Google-Thread: f9256,30fc78d511a0d982 X-Google-Attributes: gidf9256,public X-Google-Thread: 1111a3,30fc78d511a0d982 X-Google-Attributes: gid1111a3,public X-Google-Thread: 14ede5,30fc78d511a0d982 X-Google-Attributes: gid14ede5,public From: Kresten Krab Thorup <krab@california.daimi.aau.dk> Subject: Re: Hole in preprocessor support of Obj-C? Date: 1997/04/17 Message-ID: <xz6d8rtpwaz.fsf@california.daimi.aau.dk> X-Deja-AN: 235473080 References: <5j117u$oe6@medusa.is.com> Organization: DAIMI, Computer Science Dept. of Aarhus Univ. Newsgroups: comp.lang.objective-c,comp.sys.next.programmer,gnu.gcc.help,gnu.gcc.bugs