Re: compiler Flags for Code Porting
Re: compiler Flags for Code Porting
- Subject: Re: compiler Flags for Code Porting
- From: Jens Alfke <email@hidden>
- Date: Sun, 05 Jun 2011 10:37:57 -0700
On Jun 3, 2011, at 9:26 PM, koko wrote: I went ahead and did: if ((__uint32_t)m_handle != INVALID_HANDLE_VALUE) which sees OK. Any comments?
You’re hardcoding an assumption that this is 32-bit code, for no good reason. So any time in the future you try to port this code to 64-bit, you’re going to end up with potential weird runtime bugs from that line.
Any time you need to cast a pointer to an integer, you should use the standard size_t type, which is guaranteed to be the same width as a pointer.
In this case though, it looks like the proper fix is to declare INVALID_HANDLE_VALUE as a void*, as someone already pointed out.
—Jens |
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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