Re: struct "declared with greater visibility than the type of its field" warning
Re: struct "declared with greater visibility than the type of its field" warning
- Subject: Re: struct "declared with greater visibility than the type of its field" warning
- From: Alastair Houghton <email@hidden>
- Date: Tue, 27 Oct 2009 09:21:17 +0000
On 26 Oct 2009, at 22:59, Jens Alfke wrote:
I'm trying to get rid of a pesky compiler warning which makes no
sense to me. I'm wondering whether it's a GCC bug. The C++ code in
question looks like this:
struct EditorInternalCommand { ...... };
static const CommandMap& createCommandMap()
{
struct CommandEntry { const char* name; EditorInternalCommand
command; };
...
When compiled, this last line produces the warning:
warning: 'WebCore::createCommandMap()::CommandEntry' declared with
greater visibility than the type of its field
'WebCore::createCommandMap()::CommandEntry::command'
I think this is talking about *types*, not about symbols, so I *think*
the "-fvisibility" flag you mentioned is a red herring. I think the
compiler's point is that it's possible that you might be able to use
the CommandEntry structure in a scope where the EditorInternalCommand
type is not accessible.
My guess is that you aren't showing us all of the code here; is the
EditorInternalCommand type declared inside a class or in an anonymous
namespace or something? How about the createCommandMap function?
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden