Patchwork ObjC/ObjC++: Fix property encoding on Apple

login
register
mail settings
Submitter Dominique Dhumieres
Date March 2, 2011, 8:44 p.m.
Message ID <20110302204448.C84623BE18@mailhost.lps.ens.fr>
Download mbox | patch
Permalink /patch/85137/
State New
Headers show

Comments

Dominique Dhumieres - March 2, 2011, 8:44 p.m.
Nicola,

Your patch in http://gcc.gnu.org/ml/gcc-patches/2011-03/txt00002.txt
regtested fine with -m32 and -m64 provided you apply the following change:


It would probably be better to use the same "machinery" than in
gcc/testsuite/objc.dg/property/property-encoding-1.m, but doing it is
beyond my ability.

Cheers,

Dominique
Jack Howarth - March 2, 2011, 10:30 p.m.
On Wed, Mar 02, 2011 at 09:44:48PM +0100, Dominique Dhumieres wrote:
> Nicola,
> 
> Your patch in http://gcc.gnu.org/ml/gcc-patches/2011-03/txt00002.txt
> regtested fine with -m32 and -m64 provided you apply the following change:
> 
> --- property-encoding-1.mm	2011-03-02 21:03:55.000000000 +0100
> +++ /opt/gcc/work/gcc/testsuite/obj-c++.dg/property/property-encoding-1.mm	2011-03-02 21:36:23.000000000 +0100
> @@ -108,7 +108,7 @@ int main(int argc, char **args)
>      error (p);
>  
>    p = class_getProperty (c, "long_property");
> -  if (strcmp ("Tl,Vlong_property", property_getAttributes (p)) != 0)
> +  if (strcmp ("Tq,Vlong_property", property_getAttributes (p)) != 0)
>      error (p);
>  
>    p = class_getProperty (c, "float_property");
> 
> It would probably be better to use the same "machinery" than in
> gcc/testsuite/objc.dg/property/property-encoding-1.m, but doing it is
> beyond my ability.
> 
> Cheers,
> 
> Dominique

Nicola,
   With your patch and Dominique's change both the objc and obj-c++ testsuites pass
without regressions at -m32/-m64.
              Jack
Mike Stump - March 2, 2011, 10:40 p.m.
On Mar 2, 2011, at 2:30 PM, Jack Howarth wrote:
>   With your patch and Dominique's change both the objc and obj-c++ testsuites pass
> without regressions at -m32/-m64.

Updating the objc/c++ testcase is obvious if everyone is on the same page.  :-)
Nicola Pero - March 4, 2011, 3:45 p.m.
>>  With your patch and Dominique's change both the objc and obj-c++  
>> testsuites pass
>> without regressions at -m32/-m64.
>
> Updating the objc/c++ testcase is obvious if everyone is on the same  
> page.  :-)

Yes.  Thanks a lot to Jack and Dominique for the helpful review/ 
testing. :-)

I committed the testcases after updating the ObjC++ testcase to use  
the same "machinery"
as the ObjC one.  Sorry it took me so long.

Thanks
Nicola Pero - March 4, 2011, 3:45 p.m.
>>  With your patch and Dominique's change both the objc and obj-c++  
>> testsuites pass
>> without regressions at -m32/-m64.
>
> Updating the objc/c++ testcase is obvious if everyone is on the same  
> page.  :-)

Yes.  Thanks a lot to Jack and Dominique for the helpful review/ 
testing. :-)

I committed the testcases after updating the ObjC++ testcase to use  
the same "machinery"
as the ObjC one.  Sorry it took me so long.

Thanks
Dominique Dhumieres - March 4, 2011, 4:41 p.m.
Nicola,

obj-c++.dg/property/property-encoding-1.mm fails to compile with:

/opt/gcc/work/gcc/testsuite/obj-c++.dg/property/property-encoding-1.mm: In function 'char* concat(char*, char*, char*)':^M
/opt/gcc/work/gcc/testsuite/obj-c++.dg/property/property-encoding-1.mm:95:40: error: invalid conversion from 'void*' to 'char*' [-fpermissive]^M
/opt/gcc/work/gcc/testsuite/obj-c++.dg/property/property-encoding-1.mm: In function 'int main(int, char**)':^M
/opt/gcc/work/gcc/testsuite/obj-c++.dg/property/property-encoding-1.mm:112:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]^M/opt/gcc/work/gcc/testsuite/obj-c++.dg/property/property-encoding-1.mm:112:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]^M/opt/gcc/work/gcc/testsuite/obj-c++.dg/property/property-encoding-1.mm:112:61: warning: deprecated conversion from string constant to 'char*' [-Wwrite
-strings]^M
/opt/gcc/work/gcc/testsuite/obj-c++.dg/property/property-encoding-1.mm:117:63: warning: deprecated conversion from string constant to 'char*' [-Wwrite
-strings]^M
/opt/gcc/work/gcc/testsuite/obj-c++.dg/property/property-encoding-1.mm:117:63: warning: deprecated conversion from string constant to 'char*' [-Wwrite
-strings]^M
/opt/gcc/work/gcc/testsuite/obj-c++.dg/property/property-encoding-1.mm:117:63: warning: deprecated conversion from string constant to 'char*' [-Wwrite
-strings]^M
...

You cannot copy the objc code to obj-c++ (I should have said that I tried it).
You need to use the right C++ incantations, but none of the ones I tried worked
(free, +, ...).

Dominique

Patch

--- property-encoding-1.mm	2011-03-02 21:03:55.000000000 +0100
+++ /opt/gcc/work/gcc/testsuite/obj-c++.dg/property/property-encoding-1.mm	2011-03-02 21:36:23.000000000 +0100
@@ -108,7 +108,7 @@  int main(int argc, char **args)
     error (p);
 
   p = class_getProperty (c, "long_property");
-  if (strcmp ("Tl,Vlong_property", property_getAttributes (p)) != 0)
+  if (strcmp ("Tq,Vlong_property", property_getAttributes (p)) != 0)
     error (p);
 
   p = class_getProperty (c, "float_property");