Your confusion is that you expect it to make sense, whereas this particular “feature” is entirely counter-intuitive.
This explanation of the CONFIG function should help.
The problem is that the CONFIG variable can (and usually does) contain conflicting options, such as both “debug” and “release”; only the last of conflicting options is effective, but an ordinary scope test only discovers whether an option is present, not whether it is effective. Using CONFIG(debug, debug|release), for example, will test whether “debug” is the last (and hence, effective) among the “debug” and “release” options.
Bookmarks