This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++: Unused parameter even when unnamed


Given this:

     void foo(int x);
     void foo(int) {}

G++ complains that "x" is unused.  But the whole point of not giving
the parameter a name in the definition is to tell the compiler that
it's not supposed to be used.

Surely giving parameters names in prototypes isn't supposed to be a
Bad Idea?
-- 
Chip Salzenberg              - a.k.a. -              <chip@valinux.com>
"I wanted to play hopscotch with the impenetrable mystery of existence,
    but he stepped in a wormhole and had to go in early."  // MST3K

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]