This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Ignorant question about printf warnings for pointer-to-member functions
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: George Garvey <tmwg-gcc at inxservices dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: 30 Nov 2002 19:12:30 +0100
- Subject: Re: Ignorant question about printf warnings for pointer-to-member functions
- Organization: Integrable Solutions
- References: <20021130175406.GA1212@inxservices.com>
George Garvey <tmwg-gcc@inxservices.com> writes:
| This is probably from my ignorance. Is there a proper way to print
| the address below without the warning?
The short answer is: No.
[...]
| g++ -W -Wall -c question.cc
| question.cc: In function `void f(S&, void (S::*)())':
| question.cc:9: warning: format argument is not a pointer (arg 3)
Indeed. A pointer to member function is not a pointer. Any code that
makes the assumption that a pointer to member function maybe be
thought of as a pointer is broken.
-- Gaby