Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Relaxing gcc type comparison ?



Hi,
  Is there a way get gcc4 to relax its type comparison back to how it was in
gcc33, as I'm getting the following

error: a cast to a type other than an integral or enumeration type cannot
appear in a constant-expression

   As I have some #define's which are constants, but they are casted to
typedef for defaults, and previously this compiled fine. E.g.

typedef struct OBJECT__ *OBJECT;

#define RES_OBJ ((OBJECT) (ULONG_PTR)((LONG)0x80000000) )

switch ( (int)res )
{
  case (int)RES_OBJ:
  {
    ..... etc
  }
}

  But it doesn't recognise it's ended up with (int). I also tried

const int h1=(int)RES_OBJ;

switch ( (int)res )
{
  case h1:
  {
    ..... etc
  }
}

  Also didn't work :-(.

Thanks
Mark.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.