[Bug objc/45763] incorrect @encode(BOOL *)

2010-09-27 Thread nicola at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45763

--- Comment #2 from Nicola Pero nicola at gcc dot gnu.org 2010-09-27 19:22:17 
UTC ---
Author: nicola
Date: Mon Sep 27 19:22:13 2010
New Revision: 164659

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=164659
Log:
In gcc/:
2010-09-27  Nicola Pero  nicola.p...@meta-innovation.com

* doc/objc.texi (Type encoding): Added the new 'long double' (D)
code.  Added byref, which was missing in the list of codes.
Explain that enumeration values are encoded as the integer type
that the compiler uses to store them.  Explain and make examples
of how 'const' interacts with pointers, and the complication of
the encoding of 'const char *'.
(Legacy type encoding): New subsection, explaining that GCC emits
incorrect type encodings for the NeXT runtime for compatibility
reasons.
(@@encode): New subsection, explaining @encode and particularly
that protocol qualifiers are not recognized inside an @encode()
expression.
(Method signatures): New subsection, explaining how method
signatures are encoded.

In gcc/objc/:
2010-09-27  Nicola Pero  nicola.p...@meta-innovation.com

PR objc/45763
PR objc/25450
PR objc/25464
* objc-act.c: Improved comments for encoding functions.
(encode_aggregate_within): For the GNU runtime, rewritten some
obsfuscated code to clarify the various cases.
(encode_aggregate): Function removed.
(encode_array): Generate an error if asked to encode an incomplete
array as part of generating instance variables.  Else, when
encoding an incomplete array inside a structure, encode it as an
array of zero size.
(encode_pointer): For the GNU runtime, fixed encoding 'BOOL *' as
'^c' instead of '*'.
(encode_gnu_bitfield): Encode enumerated types exactly in the same
type as integer types instead of using a hardcoded 'i'.  If asked
to encode a non-integer type as a bitfield, do not abort
compilation immediately; instead generate an error, then skip the
type.
(encode_type): Use a 'switch' instead of a sequence of 'if's.
Added a 'default' clause that gets executed if the type can not be
matched, and that encodes it as '?' (unknown) and produces a
warning.  For the GNU runtime, encode enumerated types exactly in
the same way as integer types instead of using a hardcoded 'i'.
Encode long double as 'D'.  Encode 128-bit integers as 'T' or 't'.
Encode C++ reference types as pointers.  Call encode_vector to
encode vectors.
(encode_vector): New function.

2010-09-27  Nicola Pero  nicola.p...@meta-innovation.com

Merge from 'apple/trunk' branch on FSF servers.  I modified the
changes to be used only when compiling for the NeXT runtime.

2005-10-10  Fariborz Jahanian fjahan...@apple.com

Radar 4301047

* objc-act.c (encode_type): Remove the hack.

2005-07-20  Ziemowit Laski  zla...@apple.com

Radar 4136935
* objc-act.c (pointee_is_readonly): New function.
(encode_pointer, encode_aggregate_within, encode_type):
Attempt to emulate GCC 3.3 when generating type encodings.

In gcc/testsuite/:
2010-09-27  Nicola Pero  nicola.p...@meta-innovation.com

PR objc/25464
* objc.dg/type-size-3.m: New test.

2010-09-27  Nicola Pero  nicola.p...@meta-innovation.com

PR objc/45763
* objc.dg/encode-1.m: Execute the test with the GNU runtime as
well.

2010-09-27  Nicola Pero  nicola.p...@meta-innovation.com

PR objc/25450
* objc.dg/encode-3.m: Updated for fix of encoding of enums.
* objc.dg/type-size-2.m: Same change.
* obj-c++.dg/encode-5.mm: Same change.

2010-09-27  Nicola Pero  nicola.p...@meta-innovation.com

Merge from 'apple/trunk' branch on FSF servers.  The original
Changelogs are below.

* objc.dg/encode-6.m: Execute the test only with the GNU runtime.
* objc.dg/encode-6-next.m: New file (from encode-6.m in the
branch).
* objc.dg/encode-7-next.m: New file (from encode-7.m in the
branch).
* objc.dg/encode-7-next-64bit.m: New file (from encode-7-64bit.m
in the branch).
* objc.dg/proto-qual-1.m: Test the 3.3 ABI on NeXT (from
proto-qual-1.m in the branch) and the normal ABI on GNU.
* objc.dg/threedotthree-abi-1.m: New file (from the branch).  Run
the test only with the NeXT runtime.
* obj-c++/encode-1.mm: Execute the test only with the GNU runtime.
* obj-c++/encode-1-next.mm: New file (from encode-1.mm in the
branch).
* obj-c++.dg/threedotthree-abi-1.mm: New file (from the branch).
Run the test only with the NeXT runtime.

2006-03-30 Fariborz Jahanian fjahan...@apple.com

[Bug objc/45763] incorrect @encode(BOOL *)

2010-09-27 Thread nicola at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45763

Nicola Pero nicola at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #3 from Nicola Pero nicola at gcc dot gnu.org 2010-09-27 19:33:55 
UTC ---
Fixed on trunk, including a testcase to test that it is fixed. ;-)

Thanks


[Bug objc/45763] incorrect @encode(BOOL *)

2010-09-26 Thread nicola at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45763

Nicola Pero nicola at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2010.09.26 16:43:36
   date||
 AssignedTo|unassigned at gcc dot   |nicola at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1

--- Comment #1 from Nicola Pero nicola at gcc dot gnu.org 2010-09-26 16:43:36 
UTC ---
Posted a patch to gcc-patches that fixes this.

Thanks