[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    [cfe-dev] gcc incompatiblity when using joined
From:       nicolasweber () gmx ! de (Nico Weber)
Date:       2007-12-27 15:07:29
Message-ID: 3CD59AC2-1FF6-4F96-BED9-1DF1223567A1 () gmx ! de
[Download RAW message or body]

Here's a more elaborate testcase that compiles without warnings on gcc  
(and gives some compiler errors with clang):

#include <Foundation/Foundation.h>

int main()
{
   char *c;
   wchar_t *w;
   NSString *s;

   c = "hi";
   w = L"hi";
   s = @"Hi";
   s = @L"hi";
   //L@"hi";  // expected-error{{use of undeclared idenifier 'L'}}


   w = L"hi" "hi" "hi";
   w = "hi" L"hi" "hi";
   w = "hi" "hi" L"hi";

   s = @"hi" "hi" "hi";
   s = "hi" @"hi" "hi";
   s = "hi" "hi" @"hi";

   s = @"hi" L"hi" "hi";
   s = "hi" @"hi" L"hi";
   s = L"hi" "hi" @"hi";

   s = L"hi" @"hi" "hi";
   s = "hi" L"hi" @"hi";
   s = @"hi" "hi" L"hi";

   return 0;
}

Concatenating objc strings and "normal" strings is not really defined  
anywhere as far as I can tell, but it works in gcc.

Nico

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic