[PATCH] Let __attribute__((format(…))) accept OFStrings

Alp Toker alp at nuanti.com
Mon Nov 25 15:32:49 PST 2013


On 25/11/2013 00:01, Jonathan Schleifer wrote:
> Hi!
>
> Actually, the patch already became obsolete after some discussion about the patch in my other mail. The patch obsoleting it is http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131118/094025.html.
>
>> I couldn't find many projects outside of your website using the ObjFW library. If it's a personal research project, that's great but it'd be great to state it up front to help reviewers, especially since you're proposing to merge it to the stable branch.
> I did not state this as there were already ObjFW-related changes committed to Clang before, e.g. the runtime support.
>
>> Given that you're not subscribing to the mailing list, the burden would be on the rest of the community to maintain the feature once committed.
> Not exactly, no. There is actually a comment in the ObjFW runtime part inside of Clang that mentions that I maintain ObjFW-related features, including a contact address. Back then, I made an agreement with John McCall that I maintain ObjFW-related features in Clang and if I ever stop doing so for some reason, support for ObjFW is removed.

OK, my feeling is still that this should be generalised a little, 
because there are clearly multiple runtimes that can benefit from an 
attribute rather than hard-coding class names. This wasn't addressed by 
your newer patch.

Also, rjmccall isn't around so much these days so you may need to 
negotiate a new deal :-)

Alp.

>
>> The GPL licensing for the library might make it harder to set up automated tests for some people. None of this is unprecedented but generally, the less mainstream the platform, the more there's a need to make the case for it.
> There is no reason to set up automated tests that actually require ObjFW. All tests can be done inside the Clang testing framework, see the existing tests that are ObjFW-related.
>
>> On a technical level, I suspect it'd be better to generalize the problem, perhaps creating an attribute that you can apply to mark up your OFString, OFConstantString and OFMutableString so anyone else developing a runtime can also benefit from the format checker with their own classes. This is more likely to be accepted by the project than hard-coding class names into clang.
> Yes, this is actually something I have done in the patch linked above. It introduces a new format string type for OFStrings that also handles %C and %S differently, similar to how %C and %S are handled differently for NSString.
>
> Anyway, since this patch became obsolete by the patch linked above, I'd prefer it if we could continue the discussion in that thread. Thanks!
>
> PS: Please keep CCing me.
>
> --
> Jonathan

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-commits mailing list