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: Jens Alfke <email@hidden>
- Date: Tue, 27 Oct 2009 08:41:15 -0700
On Oct 27, 2009, at 2:21 AM, Alastair Houghton wrote:
I think this is talking about *types*, not about symbols, so I
*think* the "-fvisibility" flag you mentioned is a red herring.
From what I've seen by googling the text of the warning message, this
does seem to be related to -fvisibility. Types do have visibility, not
just functions and variables.
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.
But that's impossible, since CommandEntry is defined within the scope
of a function, so there's no way it can be used outside that function.
And I get the same warning if I don't name the struct at all, e.g.
struct { const char* name; EditorInternalCommand command; } commandList
[] = { ... }
In this case the warning is like "{anonymous struct} declared with
greater visibility..."
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?
Sorry, should have linked to it.
http://trac.webkit.org/browser/trunk/WebCore/editing/EditorCommand.cpp
The warning is at line 1296.
Oddly, this doesn't produce a warning in the default build of WebKit,
only when it's built for Chrome. There must be some difference in the
exact build settings.
—Jens _______________________________________________
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