-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emit a CE_Warning when CPLSet[Thread]ConfigOption() is called with a unknown config option, in debug mode #11230
base: master
Are you sure you want to change the base?
Conversation
e047a7c
to
fe75cfc
Compare
74412ec
to
6d38f54
Compare
6d38f54
to
09dd651
Compare
I don't know if this is a good idea, just tossing something out there. What if the CLI populates a global set of config options that have been specified. |
There's actually code that essentially does that, currently protected by if #DEBUG_CONFIG_OPTIONS, but at the time I wrote it, I was nervous about the performance implications of enabling that in production builds at each CPLGetConfigOption() access. Perhaps that's a not founded worry, since calling CPLGetConfigOption() has already performance implications, and shouldn't be done in performance sensitive loops. |
09dd651
to
a49b21f
Compare
If the behavior is opt-in ( |
believe we should only warn about things that are proven issues (specifying a non existing config option), otherwise users will dismiss the avalanche of warnings. Or there should be a GDAL_SHOW_UNUSED_CONFIG_OPTIONS option to enable that behavior. |
… check to verify it is up-to-date
…tting CPL_DEBUG is done first
…unknown config option, in debug mode and add CPLDeclareKnownConfigOption()
a49b21f
to
9bda155
Compare
But the options written into the |
with this PR, yes they will be checked, as they are set through CPLSetConfigOption(): Line 2302 in d9b65d7
|
$ gdalinfo --config BAD_OPTION=TEST --debug on --version Warning 1: Unknown configuration option 'BAD_OPTION'.