This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PING^2] [C/C++] PR c/4076 -Wunused doesn't warn about static function only called by itself


Manuel López-Ibáñez wrote:

I could but I was not able to construct a case where it was necessary.
How can a static function make a scoped recursive call? Sorry my
knowledge of C++ is not so good.

namespace { struct X { void Foo () { X::Foo (); }}}


might just cut it. Yes I know anonymous namespaces are not quite the same as static, and I don't know if we'll check this, but it seems wise to copy the idiom you've introduced.

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk


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