I made two notable changes: I renamed the function, since it looked like EmitWarningsOnPlaceholders() but was doing something not analogous.
Also, you had in your function
strncmp(varName, var->name, varLen)
probably copied from EmitWarningsOnPlaceholders(), but unlike there, we want to compare the whole string here, and this would potentially do something wrong if there were a GUC setting that was a substring of the name of another one.
Yeah, it makes sense!
Thank you very much!
Thank you for the changes and thank you for committing it!