PixarAnimationStudios / OpenSubdiv

An Open-Source subdivision surface library.
graphics.pixar.com/opensubdiv
Other
2.89k stars 561 forks source link

Mismatched declaration and definition of array type #1287

Closed thomthom closed 1 year ago

thomthom commented 1 year ago

I was testing Clang LLVM 15.0.5 on macOS. Caught this warning:

[build] /Users/thomas/SourceTree/subd/ThirdParty/OpenSubdiv/opensubdiv/vtr/level.cpp:1133:64: warning: argument 'points' of type 'OpenSubdiv::v3_5_0::Vtr::Index[12]' (aka 'int[12]') with mismatched bound [-Warray-parameter]
[build] Level::gatherTriRegularInteriorPatchPoints(Index fIndex, Index points[12], int rotation) const
[build]                                                                ^
[build] /Users/thomas/SourceTree/subd/ThirdParty/OpenSubdiv/opensubdiv/vtr/../vtr/level.h:371:71: note: previously declared as 'OpenSubdiv::v3_5_0::Vtr::Index[]' (aka 'int[]') here
[build]     int gatherTriRegularInteriorPatchPoints(      Index fIndex, Index patchVerts[], int rotation = 0) const;
[build]                                                                       ^
[build] 1 warning generated.

It's declared as:

int gatherTriRegularInteriorPatchPoints(      Index fIndex, Index patchVerts[], int rotation = 0) const;

But defined as:

int
Level::gatherTriRegularInteriorPatchPoints(Index fIndex, Index points[12], int rotation) const

Implementation suggests that the array is indeed expected to have exactly 12 items.

davidgyu commented 1 year ago

Filed as internal issue #OSD-399

davidgyu commented 1 year ago

Fixed by merging #1290