This is the mail archive of the gcc-patches@gcc.gnu.org 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 %@ ?


> (I also believe we need to take care not to paint ourselves into a  
> corner tho' - since the Apple version of ObjC does not define this  
> operation yet).

What do you mean ?  __attribute__((format (NSString, 1, 2))) works
on Apple (using LLVM I think, I don't have an Apple but I know it's
there) and it works as expected.  The standard example is NSLog 
(in much the same way as the standard example of the printf format 
is printf) and that is very well-defined.  GNUstep has NSLog and I can't
wait for the compiler to check that the arguments passed to NSLog
match the format string. ;-)

And since I implemented format attributes for methods, we should immediately
be able to have the compiler check [NSString -stringWithFormat:] as well ...

Thanks


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