Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#46 error: assignment of read-only member 'ptr'

v0.6.0 Beta
open
Mac OS X (2)
5
2009-11-06
2009-11-06
No

/Users/Shared/sourceforge/regexkit/branches/Release/0.6.0/Source/NSString.m: In function 'RKAppendInstruction':
/Users/Shared/sourceforge/regexkit/branches/Release/0.6.0/Source/NSString.m:962: error: assignment of read-only member 'ptr'
/Users/Shared/sourceforge/regexkit/branches/Release/0.6.0/Source/NSString.m: In function 'RKAppendCopyInstruction':
/Users/Shared/sourceforge/regexkit/branches/Release/0.6.0/Source/NSString.m:1005: error: assignment of read-only member 'ptr'

The above is a sample of the (six total) compilation errors I've encountered while trying to build RegexKit on Snow Leopard. I've made some very minor tweaks to the project file to enable x86_64 support (basically told Xcode to update the 3.1 format and then use the new "Standard (32/64-bit Universal)" Architectures setting).

At first brush the errors seem valid, as there is indeed a const qualifier on the ptr members in these two structures:

struct referenceInstruction {
int op;
RK_STRONG_REF const void * RK_C99(restrict) ptr;
NSRange range;
};

struct copyInstruction {
RK_STRONG_REF const void * RK_C99(restrict) ptr;
RKUInteger length;
};

However, interestingly, commenting out both the const and restrict qualifiers still didn't eliminate the error. (!) And I'm certain that these are the right structs and that my changes were being seen, because mashing the name to ptrx caused the expected 'no such member' errors on those same lines. (!!!)

I am scratching my head over this one...

Discussion