This is the mail archive of the
mailing list for the GCC project.
Re: Updated: [Patch, c* ,ObjC*] handle string objects in format checking.
- From: "Nicola Pero" <nicola dot pero at meta-innovation dot com>
- To: "IainS" <developer at sandoe-acoustics dot co dot uk>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, "GCC Patches" <gcc-patches at gcc dot gnu dot org>, "Mike Stump" <mrs at gcc dot gnu dot org>, "Mike Stump" <mikestump at comcast dot net>
- Date: Mon, 1 Nov 2010 10:27:24 +0100 (CET)
- Subject: Re: Updated: [Patch, c* ,ObjC*] handle string objects in format checking.
- References: <firstname.lastname@example.org> <12CA4F9C-A788-4187-81A2-626AE2A40A5A@sandoe-acoustics.co.uk>
> This is because the string literal behind an NS (or CF) string need
> not be ascii or even utf8 -- it could be utf16 (although we haven't
> implemented that yet).
Hmmm. Excellent point by the way. ;-)
I still think we should do the NSString formatting in c-format.c. I don't
want to rewrite and maintain the whole of c-format.c in gcc/objc/. ;-)
[and in your patch you have another placeholder for CFString formatting in Darwin ... I
don't think we'd want to duplicate the entire printf formatting yet another time for
Darwin just to allow CFStringRefs to be used instead of NSStrings ;-).]
We can probably find some sort of solution even for unicode strings.
Probably ObjC could return the constant string converted to UTF-8 so that
it can be fed into c-format.c without particular any changes to c-format.c ?
> In any event, have you any objection to first applying the syntax and
> parsing logic - assuming Joseph is now happy with it (since that patch
> is already reviewed twice) and then filling in the implementation?
No, I have no objection to doing it in two phases. But it would make sense
to consider the second step when doing the first one. :-)