This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Updated: [Patch, c* ,ObjC*] handle string objects in format checking.

>> The actual scanning of the format strings is now local to ObjC
>> (there's a stub routine added by the patch) and additions to carry
>> that out would fall under whatever rules Mike wishes to invoke.
>> Wouldn't we reuse the existing routines and simply add %@ ?
> Hm.
> I think to double-check the doc.
> IIRC there were some subtle differences from c. (on NeXT, at least)...

As far as I know, there are no intended differences other than the addition
of %@ (in other words, my description of the NSString format in my other
email should be correct and complete).

If you need to see Apple documentation, here it is --

It says 

"NSString uses a format string whose syntax is similar to that used by other formatter objects. 
It supports the format characters defined for the ANSI C function printf(), plus %@ for any object 
(see âString Format Specifiersâ and the IEEE printf specification)."

In attach is a draft patch I had produced during the weekend - it works for me with the GNU runtime on top
of my other patches (but it doesn't include documentation (and not enough comments), has a few hacks and
rough edges, most likelyl won't work on Darwin and it doesn't do Objective-C++ yet). ;-)

Feel free to clean it up, steal the bits that you need, drop the ones that you don't need, make it work with Darwin 
as well as the GNU runtime and generally merge it with yours so we get full NSString format in 4.6.0. :-)

I hope that helps.  I'll now take a few days off the compiler, then come back in a few days to start 
the bug fixing round. :-)


Attachment: patch.txt
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]