Why does C++ code missing a formal argument name in a function definition compile without warnings?
While getting started with some VS2005-generated MFC code, I noticed it overrode a method with something like this: void OnDraw(CDC* /*pDC*/) { ... // TODO: Add your code here } So of course, as soon as I added something I realized I needed to un-comment the pDC formal argument in order to compile, but I'm confused as to how/why a C++ function can compile (with no warnings) when the formal argument only has a type and not a name: void foo(int) { int x = 3; } int main() { foo(5); return 0; } Shouldn't this generate at least a warning (with -Wall or /W4)? It doesn't seem to. Am I missing