For example, --warn-unused-macros can get the same result as -Wunused-macros.
Mmh, indeed it appears to be an undocumented alternative way to specify -W...
parameters (it is not even reported by gcc --help=warnings
). However I only did a quick search, so it may be documented somewhere (maybe someone else may point to the documentation if they found it).
Also, if I execute gcc --warn-long-long2
, GCC will correctly tell me that I may have misspelled the --warn-long-long
option (a.k.a. -Wlong-long
). So, suggestions correctly work for this alternate naming.
How does gcc lead the two options to the same result?
The two options lead to the same result simply because GCC treats them as the same option with different names. Many softwares have several names for the same option. I'm not sure what your doubt/question is about this.
Do you want to know specifically how GCC parse command line options internally?