This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: More Objective C @"string" bugs...
- To: Zack Weinberg <zackw at stanford dot edu>
- Subject: Re: More Objective C @"string" bugs...
- From: Nicola Pero <n dot pero at mi dot flashnet dot it>
- Date: Tue, 6 Mar 2001 00:45:20 +0100 (CET)
- cc: gcc-bugs at gcc dot gnu dot org, Ovidiu Predescu <ovidiu at cup dot hp dot com>
- Reply-To: Nicola Pero <n dot pero at mi dot flashnet dot it>
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
>