Closed Bug 1134931 Opened 5 years ago Closed 5 years ago

Fix Winconsistent-missing-override warnings in nsFrameMessageManager.cpp, ServiceWorkerManager.cpp, and gfx/2d/2D.h

Categories

(Core :: General, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla38
Tracking Status
firefox38 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Noticed a bunch of these when building with clang trunk (for everything that #includes 2D.h): 
{
 0:52.00 ../../dist/include/mozilla/gfx/2D.h:374:3: warning: 'typeName' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
 0:52.01   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurface)
 0:52.01   ^
 0:52.01 ../../dist/include/mozilla/RefPtr.h:167:23: note: expanded from macro 'MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME'
 0:52.01   virtual const char* typeName() const __VA_ARGS__ { return #T; } \
 0:52.01                       ^
 0:52.01 ../../dist/include/mozilla/gfx/2D.h:324:3: note: overridden virtual function is here
 0:52.01   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SourceSurface)
 0:52.01   ^
 0:52.01 ../../dist/include/mozilla/RefPtr.h:167:23: note: expanded from macro 'MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME'
 0:52.01   virtual const char* typeName() const __VA_ARGS__ { return #T; } \
 0:52.01                       ^

and simiarly:l
 0:52.01 ../../dist/include/mozilla/gfx/2D.h:374:3: warning: 'typeSize' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
 0:52.01   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(DataSourceSurface)
 0:52.01   ^
 0:52.01
}

And also:
{
dom/workers/ServiceWorkerManager.cpp:2157:3: warning: 'VisitHeader' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   VisitHeader(const nsACString& aHeader, const nsACString& aValue)
   ^
 ../../dist/include/nsIHttpHeaderVisitor.h:31:14: note: overridden virtual function is here
   NS_IMETHOD VisitHeader(const nsACString & aHeader, const nsACString & aValue) = 0;
              ^
}

...and:
{
dom/workers/ServiceWorkerManager.cpp:2198:3: warning: 'WorkerRun' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
   ^
}
(Sanity-check, because it wasn't 100% obvious: WorkerRun() is indeed intended to override here -- it overrides a function defined in the superclass "WorkerRunnable".)

ehsan granted me blanket r=him for obviously-missing MOZ_OVERRIDE annotations, over in bug 1126447, so I'm going to make use of that here.
Attached patch fixSplinter Review
I'm also fixing a few more instances of this warning that I caught when rebuilding mozilla-inbound before landing:
{
$SRC/dom/base/nsFrameMessageManager.cpp:1738:16: error: 'DoSendAsyncMessage' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
  virtual bool DoSendAsyncMessage(JSContext* aCx,
               ^
$SRC/dom/base/nsFrameMessageManager.h:73:16: note: overridden virtual function is here
  virtual bool DoSendAsyncMessage(JSContext* aCx,
               ^
$SRC/dom/base/nsFrameMessageManager.cpp:1751:8: error: 'CheckPermission' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
  bool CheckPermission(const nsAString& aPermission)
       ^
$SRC/dom/base/nsFrameMessageManager.h:82:16: note: overridden virtual function is here
  virtual bool CheckPermission(const nsAString& aPermission)
               ^
$SRC/dom/base/nsFrameMessageManager.cpp:1757:8: error: 'CheckManifestURL' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
  bool CheckManifestURL(const nsAString& aManifestURL)
       ^
$SRC/dom/base/nsFrameMessageManager.h:87:16: note: overridden virtual function is here
  virtual bool CheckManifestURL(const nsAString& aManifestURL)
               ^
$SRC/dom/base/nsFrameMessageManager.cpp:1763:8: error: 'CheckAppHasPermission' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
  bool CheckAppHasPermission(const nsAString& aPermission)
       ^
$SRC/dom/base/nsFrameMessageManager.h:92:16: note: overridden virtual function is here
  virtual bool CheckAppHasPermission(const nsAString& aPermission)
               ^
$SRC/dom/base/nsFrameMessageManager.cpp:1769:16: error: 'CheckAppHasStatus' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
  virtual bool CheckAppHasStatus(unsigned short aStatus)
               ^
$SRC/dom/base/nsFrameMessageManager.h:97:16: note: overridden virtual function is here
  virtual bool CheckAppHasStatus(unsigned short aStatus)
               ^
}

I'll land the fix when the tree reopens.
Summary: Fix Winconsistent-missing-override warnings in dom/workers and gfx/2d/2D.h → Fix Winconsistent-missing-override warnings in nsFrameMessageManager.cpp, ServiceWorkerManager.cpp, and gfx/2d/2D.h
https://hg.mozilla.org/mozilla-central/rev/00ea6409e912
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.