PixarAnimationStudios / OpenUSD

Universal Scene Description
http://www.openusd.org
Other
6.17k stars 1.23k forks source link

Compiler Warnings: Overrides a member function but is not marked override #3335

Open dgovil opened 1 month ago

dgovil commented 1 month ago

Description of Issue

There are a range of methods that do not declare themselves as overrides. This should be a fairly straightforward change to make, and would clean up a lot of issues/compiler ambiguity. I think this is a good first time issue for someone getting started with the USD codebase.

I am building with Clang 16 from Xcode 16 with python3 ./build_scripts/build_usd.py ~/Downloads/usd --build-variant debug --no-imaging -vvv but this should reproduce with other compilers. The warnings are reproduced below:

[1833/4632] Building CXX object pxr/usd/usdUtils/CMakeFiles/usdUtils.dir/assetLocalizationPackage.cpp.o
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationPackage.cpp:18:
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalization.h:17:
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:274:38: warning: 'ProcessPayloads' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  274 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:50:38: note: overridden virtual function is here
   50 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
1 warning generated.
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationPackage.cpp:18:
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalization.h:17:
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:274:38: warning: 'ProcessPayloads' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  274 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:50:38: note: overridden virtual function is here
   50 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
1 warning generated.
[1835/4632] Building CXX object pxr/usd/usdUtils/CMakeFiles/usdUtils.dir/localizeAsset.cpp.o
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/localizeAsset.cpp:21:
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalization.h:17:
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:274:38: warning: 'ProcessPayloads' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  274 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:50:38: note: overridden virtual function is here
   50 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
1 warning generated.
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/localizeAsset.cpp:21:
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalization.h:17:
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:274:38: warning: 'ProcessPayloads' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  274 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:50:38: note: overridden virtual function is here
   50 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
1 warning generated.
[1850/4632] Building CXX object pxr/usd/usdUtils/CMakeFiles/usdUtils.dir/assetLocalization.cpp.o
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalization.cpp:10:
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalization.h:17:
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:274:38: warning: 'ProcessPayloads' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  274 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:50:38: note: overridden virtual function is here
   50 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
1 warning generated.
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalization.cpp:10:
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalization.h:17:
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:274:38: warning: 'ProcessPayloads' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  274 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:50:38: note: overridden virtual function is here
   50 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
1 warning generated.
[1858/4632] Building CXX object pxr/usd/usdUtils/CMakeFiles/usdUtils.dir/assetLocalizationDelegate.cpp.o
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.cpp:10:
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:274:38: warning: 'ProcessPayloads' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  274 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:50:38: note: overridden virtual function is here
   50 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
1 warning generated.
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.cpp:10:
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:274:38: warning: 'ProcessPayloads' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  274 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:50:38: note: overridden virtual function is here
   50 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
1 warning generated.
[1861/4632] Building CXX object pxr/usd/usdUtils/CMakeFiles/usdUtils.dir/dependencies.cpp.o
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/dependencies.cpp:13:
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalization.h:17:
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:274:38: warning: 'ProcessPayloads' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  274 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:50:38: note: overridden virtual function is here
   50 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
1 warning generated.
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/dependencies.cpp:13:
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalization.h:17:
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:274:38: warning: 'ProcessPayloads' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  274 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:50:38: note: overridden virtual function is here
   50 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
1 warning generated.
[2059/4632] Building CXX object pxr/usd/usdUtils/CMakeFiles/usdUtils.dir/usdzPackage.cpp.o
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/usdzPackage.cpp:10:
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalization.h:17:
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:274:38: warning: 'ProcessPayloads' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  274 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:50:38: note: overridden virtual function is here
   50 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
1 warning generated.
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/usdzPackage.cpp:10:
In file included from /Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalization.h:17:
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:274:38: warning: 'ProcessPayloads' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  274 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
/Users/dhruvgovil/Projects/usd/pxr/usd/usdUtils/assetLocalizationDelegate.h:50:38: note: overridden virtual function is here
   50 |     virtual std::vector<std::string> ProcessPayloads(
      |                                      ^
1 warning generated.

[3068/4632] Building CXX object pxr/usdImaging/usdImaging/CMakeFiles/usdImaging.dir/cylinderLightAdapter.cpp.o
In file included from /Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/cylinderLightAdapter.cpp:7:
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/cylinderLightAdapter.h:50:21: warning: 'Populate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   50 |     virtual SdfPath Populate(UsdPrim const& prim,
      |                     ^
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/lightAdapter.h:55:13: note: overridden virtual function is here
   55 |     SdfPath Populate(UsdPrim const& prim,
      |             ^
In file included from /Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/cylinderLightAdapter.cpp:7:
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/cylinderLightAdapter.h:55:18: warning: 'IsSupported' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   55 |     virtual bool IsSupported(UsdImagingIndexProxy const* index) const;
      |                  ^
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/lightAdapter.h:60:10: note: overridden virtual function is here
   60 |     bool IsSupported(UsdImagingIndexProxy const* index) const override;
      |          ^
2 warnings generated.
In file included from /Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/cylinderLightAdapter.cpp:7:
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/cylinderLightAdapter.h:50:21: warning: 'Populate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   50 |     virtual SdfPath Populate(UsdPrim const& prim,
      |                     ^
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/lightAdapter.h:55:13: note: overridden virtual function is here
   55 |     SdfPath Populate(UsdPrim const& prim,
      |             ^
In file included from /Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/cylinderLightAdapter.cpp:7:
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/cylinderLightAdapter.h:55:18: warning: 'IsSupported' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   55 |     virtual bool IsSupported(UsdImagingIndexProxy const* index) const;
      |                  ^
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/lightAdapter.h:60:10: note: overridden virtual function is here
   60 |     bool IsSupported(UsdImagingIndexProxy const* index) const override;
      |          ^
2 warnings generated.
[3154/4632] Building CXX object pxr/usdImaging/usdImaging/CMakeFiles/usdImaging.dir/portalLightAdapter.cpp.o
In file included from /Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/portalLightAdapter.cpp:7:
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/portalLightAdapter.h:37:21: warning: 'Populate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   37 |     virtual SdfPath Populate(UsdPrim const& prim,
      |                     ^
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/lightAdapter.h:55:13: note: overridden virtual function is here
   55 |     SdfPath Populate(UsdPrim const& prim,
      |             ^
In file included from /Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/portalLightAdapter.cpp:7:
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/portalLightAdapter.h:42:18: warning: 'IsSupported' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   42 |     virtual bool IsSupported(UsdImagingIndexProxy const* index) const;
      |                  ^
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/lightAdapter.h:60:10: note: overridden virtual function is here
   60 |     bool IsSupported(UsdImagingIndexProxy const* index) const override;
      |          ^
2 warnings generated.
In file included from /Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/portalLightAdapter.cpp:7:
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/portalLightAdapter.h:37:21: warning: 'Populate' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   37 |     virtual SdfPath Populate(UsdPrim const& prim,
      |                     ^
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/lightAdapter.h:55:13: note: overridden virtual function is here
   55 |     SdfPath Populate(UsdPrim const& prim,
      |             ^
In file included from /Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/portalLightAdapter.cpp:7:
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/portalLightAdapter.h:42:18: warning: 'IsSupported' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   42 |     virtual bool IsSupported(UsdImagingIndexProxy const* index) const;
      |                  ^
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/lightAdapter.h:60:10: note: overridden virtual function is here
   60 |     bool IsSupported(UsdImagingIndexProxy const* index) const override;
      |          ^
2 warnings generated.
[3261/4632] Building CXX object pxr/usdImaging/usdImaging/CMakeFiles/usdImaging.dir/tetMeshAdapter.cpp.o
In file included from /Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/tetMeshAdapter.cpp:6:
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/tetMeshAdapter.h:80:10: warning: 'TrackVariability' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   80 |     void TrackVariability(UsdPrim const& prim,
      |          ^
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/gprimAdapter.h:52:10: note: overridden virtual function is here
   52 |     void TrackVariability(UsdPrim const& prim,
      |          ^
1 warning generated.
In file included from /Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/tetMeshAdapter.cpp:6:
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/tetMeshAdapter.h:80:10: warning: 'TrackVariability' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
   80 |     void TrackVariability(UsdPrim const& prim,
      |          ^
/Users/dhruvgovil/Projects/usd/pxr/usdImaging/usdImaging/gprimAdapter.h:52:10: note: overridden virtual function is here
   52 |     void TrackVariability(UsdPrim const& prim,
      |          ^
1 warning generated.
jesschimein commented 1 month ago

Filed as internal issue #USD-10232