• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Code completion misunderstands unions in structs?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Code completion misunderstands unions in structs?


  • Subject: Code completion misunderstands unions in structs?
  • From: "Karan, Cem" <email@hidden>
  • Date: Tue, 7 Dec 2004 12:37:36 -0500
  • Thread-topic: Code completion misunderstands unions in structs?

I just wanted to run this past everyone before I write a bug report to
see if others have had the same problems.

I have a lot of C code that works something like that below to make a
pseudo-OO language out of C (I have no option but to use C on this
project):

/*** In individual private headers/.c files ***/

typedef struct derivedTypeA
{
	int foo;
} *derivedA;

typedef struct derivedTypeB
{
	char bar;
} *derivedB;

typedef struct derivedTypeC
{
	int foo;
	int baz;
} *derivedC;

typedef struct derivedTypeD
{
	float foo;
} *derivedD;

/*** In single public file ***/

typedef enum myType
{
	typeA,
	typeB,
	typeC,
	typeD,
} myType;

typedef struct myBaseClassType
{
	myType type;

	union
	{
		derivedA A;
		derivedB B;
		derivedC C;
		derivedD D;
	} object;
} *myBaseClass;

The problem is that code completion doesn't understand the union within
the struct correctly; if I have an instance gamma of type myBaseClass,
then typing "gamma->" doesn't result in a list consisting of type and
object, but a list of "type, A, B, C, D", which is incorrect;  I would
need to have "type, object.A, object.B, object.C, object.D" or "type,
object", and then after I type or select the start of object, have the
list for A,B,C,D come up.  Is anyone else seeing/doing this sort of
thing?

Thanks,
Cem Karan
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Database connection help.....
  • Next by Date: self-contained XCode project
  • Previous by thread: Re: Database connection help.....
  • Next by thread: self-contained XCode project
  • Index(es):
    • Date
    • Thread