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

Nicola Pero nicola.pero@meta-innovation.com
Mon Nov 1 04:38:00 GMT 2010


>> 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 --

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Strings/Articles/FormatStrings.html#//apple_ref/doc/uid/20000943-CJBEAEHH

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. :-)

Thanks
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20101101/e6c5aeac/attachment.txt>


More information about the Gcc-patches mailing list