Re: MoreCRC - target of assignment not really an lvalue; this will be a hard error in the future
Re: MoreCRC - target of assignment not really an lvalue; this will be a hard error in the future
- Subject: Re: MoreCRC - target of assignment not really an lvalue; this will be a hard error in the future
- From: Quinn <email@hidden>
- Date: Tue, 15 Jul 2008 09:29:47 +0100
At 18:41 -0700 14/7/08, Mike wrote:
Does anyone know how to turn off this error in XCode 2.5 or fix the
code so that it doesn't occur?
I've fixed this in my internal repository. The diffs between the
version on the web and my fixed version are below. The key point is:
#define DO1(buf) crc = gTable[(crc ^ (*((UInt8*)buf)++)) & 0xff] ^ (crc >> 8)
which casts buf to a (UInt8 *) and then tries to increment it, a
construct that GCC now complains about (as well it should). I've
fixed this by adding a new local variable, buf8, that is a (const
UInt8 *), and changing the macro to:
#define DO1(buf) crc = gTable[(crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
$ diff MoreIsBetter-web/MIB-Libraries/MoreCRC/MoreCRC.c
MoreIsBetter/MIB-Libraries/MoreCRC/MoreCRC.c
8c8
< Copyright: Copyright (c) 1998-2001 by Apple Computer,
Inc., All Rights Reserved.
---
Copyright: Copyright (c) 2006 by Apple Computer, Inc.,
All Rights Reserved.
17c17
< to these terms, Apple grants you a
personal, non-exclusive license, under Apple?s
---
to these terms, Apple grants you a
personal, non-exclusive license, under Apple's
48c48,57
< Revision 1.5 2002/11/08 23:18:53
---
Revision 1.8 2006/03/27 14:38:32 eskimo1
Eliminate high-bit set characters.
Revision 1.7 2006/03/24 15:41:21 eskimo1
Updated copyright.
Revision 1.6 2006/03/23 15:23:34 eskimo1
Correct a compiler warning.
Revision 1.5 2002/11/08 23:18:53 eskimo1
51c60
< Revision 1.4 2001/11/07 15:52:05
---
Revision 1.4 2001/11/07 15:52:05 eskimo1
69c78
< Copyright (c) 1995-2001 by Apple Computer, Inc., All Rights Reserved.
---
Copyright (c) 2006 by Apple Computer, Inc., All Rights Reserved.
160c169
< #define DO1(buf) crc = gTable[(crc ^ (*((UInt8*)buf)++)) & 0xff] ^ (crc >> 8)
---
#define DO1(buf) crc = gTable[(crc ^ (*buf++)) & 0xff] ^ (crc >> 8)
167c176,179
< if (buf == NULL) {
---
const UInt8 * buf8;
buf8 = buf;
if (buf8 == NULL) {
176c188
< DO8(buf);
---
DO8(buf8);
182c194
< DO1(buf);
---
DO1(buf8);
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden