This is the mail archive of the gcc-bugs@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]

Re: More Objective C @"string" bugs...



Yes - you are right - I think this is the same bug I reported in
http://gcc.gnu.org/ml/gcc-patches/2001-03/msg00152.html (probably - my
fault - I should have posted to gcc-bugs rather than gcc-patches) 

It appears only in the CVS head and not in the 3.0 branch.

On Mon, 5 Mar 2001, Zack Weinberg wrote:

> This program will return exit status 2:
> 
> @interface Object
> {
>   struct objc_class *isa;
> }
> @end
> 
> @interface NXConstantString : Object
> {
>   char *c_string;
>   unsigned int len;
> }
> - (const char *) cString;
> @end
> 
> int main(int argc, void **args)
> {
>   NXConstantString *s = @"this is a string";
>   if (s == 0)
>     return 1;
>   if ([s cString] == 0)
>     return 2;
>   return 0;
> }
> 
> I'm not sure what's wrong, but I note that "this is a string" does not
> appear anywhere in the assembly dump.
> 
> This may explain why string-*.m fail on some targets and not others;
> if your libc doesn't segfault when you call printf(NULL), the bug is
> masked.
> 
> zw
> 


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