| 2031 | /************************************************************************/ |
| 2032 | |
| 2033 | static void CPLSetConfigOptionDetectUnknownConfigOption(const char *pszKey, |
| 2034 | const char *pszValue) |
| 2035 | { |
| 2036 | if (EQUAL(pszKey, "CPL_DEBUG")) |
| 2037 | { |
| 2038 | gnDebug = pszValue ? CPLTestBool(pszValue) : false; |
| 2039 | } |
| 2040 | else if (CPLIsDebugEnabled()) |
| 2041 | { |
| 2042 | if (!std::binary_search(std::begin(apszKnownConfigOptions), |
| 2043 | std::end(apszKnownConfigOptions), pszKey, |
| 2044 | [](const char *a, const char *b) |
| 2045 | { return STRCASECMP(a, b) < 0; })) |
| 2046 | { |
| 2047 | bool bFound; |
| 2048 | { |
| 2049 | std::lock_guard oLock(goMutexDeclaredKnownConfigOptions); |
| 2050 | bFound = cpl::contains(goSetKnownConfigOptions, |
| 2051 | CPLString(pszKey).toupper()); |
| 2052 | } |
| 2053 | if (!bFound) |
| 2054 | { |
| 2055 | const char *pszOldValue = CPLGetConfigOption(pszKey, nullptr); |
| 2056 | if (!((!pszValue && !pszOldValue) || |
| 2057 | (pszValue && pszOldValue && |
| 2058 | EQUAL(pszValue, pszOldValue)))) |
| 2059 | { |
| 2060 | CPLError(CE_Warning, CPLE_AppDefined, |
| 2061 | "Unknown configuration option '%s'.", pszKey); |
| 2062 | } |
| 2063 | } |
| 2064 | } |
| 2065 | } |
| 2066 | } |
| 2067 | |
| 2068 | /************************************************************************/ |
| 2069 | /* CPLSetConfigOption() */ |
no test coverage detected