I'm getting persistent const qualifier warnings with MSVC 2005 Express, along these lines:
..\extra\uriparser\uriparser.c(227) : warning C4090: 'function' : different 'const' qualifiers where line 227 looks like add_next_index_stringl(path_array, walker->text.first, walker->text.afterLast - walker->text.first, 1); ...where walker->text.first is a const char*. Now, because Zend is duplicating the value, it should be possible for this pointer to be const without causing warnings. (The alternative to estrndup it myself and not use duplicate, but that kind of defeats the purpose of duplicate, doesn't it?). As it turns out, it appears this message appears elsewhere in extensions too (just grep the Windows snapshot logs for C4090: 'function'). Since C doesn't support function overloading, this would probably mean macro-fying the relevant functions in the core to call separate duplicate and non-duplicate functions. In addition, the ZVAL_ macros would need to somehow add a const qualifier to the temporary string pointer if duplicate is true (I don't know if that's possible or not). I can produce a patch, although monkeying around in Zend is something probably best left to the experts. Still, I'm wondering if this would be a good idea or not. Code-wise, it should be fully backwards and forwards compatible (warnings simply disappear in newer versions), although it wouldn't be binary compatible. Or you could just tell me to estrndup. Thanks! -- Edward Z. Yang GnuPG: 0x869C48DA HTML Purifier <http://htmlpurifier.org> Anti-XSS Filter [[ 3FA8 E9A9 7385 B691 A6FC B3CB A933 BE7D 869C 48DA ]] -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php