Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: type mismatch with clang10 and 32bit #1198

Open
sambler opened this issue Jun 20, 2020 · 3 comments
Open

Error: type mismatch with clang10 and 32bit #1198

sambler opened this issue Jun 20, 2020 · 3 comments

Comments

@sambler
Copy link

sambler commented Jun 20, 2020

I am getting a build failure when using clang10 on a 32bit system. Test system is FreeBSD 12.1 i386

error: assigning to 'OpenSubdiv::v3_4_3::HbrMemStatFunction' (aka 'void (*)(unsigned int)') from incompatible type 'void (*)(unsigned long)': type mismatch at 1st parameter ('size_t' (aka 'unsigned int') vs 'unsigned long')

failed step is -

[64/313] /usr/local/bin/clang++10  -DGLFW_VERSION_3 -DOPENSUBDIV_HAS_GLSL_COMPUTE -DOPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK -DOPENSUBDIV_HAS_OPENGL -DOPENSUBDIV_HAS_PTEX -DOPENSUBDIV_HAS_TBB -DOPENSUBDIV_VERSION_STRING=\"3.4.3\" -DOSD_USES_INTERNAL_GLAPILOADER -DPTEX_STATIC -I/wrkdirs/usr/ports/graphics/opensubdiv/work/OpenSubdiv-3_4_3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -Wall -Wextra -Wno-invalid-offsetof -Wno-strict-aliasing -Wno-overloaded-virtual -MD -MT regression/far_regression/CMakeFiles/far_regression.dir/far_regression.cpp.o -MF regression/far_regression/CMakeFiles/far_regression.dir/far_regression.cpp.o.d -o regression/far_regression/CMakeFiles/far_regression.dir/far_regression.cpp.o -c /wrkdirs/usr/ports/graphics/opensubdiv/work/OpenSubdiv-3_4_3/regression/far_regression/far_regression.cpp
FAILED: regression/far_regression/CMakeFiles/far_regression.dir/far_regression.cpp.o 
/usr/local/bin/clang++10  -DGLFW_VERSION_3 -DOPENSUBDIV_HAS_GLSL_COMPUTE -DOPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK -DOPENSUBDIV_HAS_OPENGL -DOPENSUBDIV_HAS_PTEX -DOPENSUBDIV_HAS_TBB -DOPENSUBDIV_VERSION_STRING=\"3.4.3\" -DOSD_USES_INTERNAL_GLAPILOADER -DPTEX_STATIC -I/wrkdirs/usr/ports/graphics/opensubdiv/work/OpenSubdiv-3_4_3 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing  -O2 -pipe -fstack-protector-strong -fno-strict-aliasing   -Wall -Wextra -Wno-invalid-offsetof -Wno-strict-aliasing -Wno-overloaded-virtual -MD -MT regression/far_regression/CMakeFiles/far_regression.dir/far_regression.cpp.o -MF regression/far_regression/CMakeFiles/far_regression.dir/far_regression.cpp.o.d -o regression/far_regression/CMakeFiles/far_regression.dir/far_regression.cpp.o -c /wrkdirs/usr/ports/graphics/opensubdiv/work/OpenSubdiv-3_4_3/regression/far_regression/far_regression.cpp
In file included from /wrkdirs/usr/ports/graphics/opensubdiv/work/OpenSubdiv-3_4_3/regression/far_regression/far_regression.cpp:29:
In file included from /wrkdirs/usr/ports/graphics/opensubdiv/work/OpenSubdiv-3_4_3/regression/far_regression/../../regression/common/hbr_utils.h:34:
/wrkdirs/usr/ports/graphics/opensubdiv/work/OpenSubdiv-3_4_3/opensubdiv/hbr/../hbr/mesh.h:223:31: error: assigning to 'OpenSubdiv::v3_4_3::HbrMemStatFunction' (aka 'void (*)(unsigned int)') from incompatible type 'void (*)(unsigned long)': type mismatch at 1st parameter ('size_t' (aka 'unsigned int') vs 'unsigned long')
        s_memStatsIncrement = increment;
                              ^~~~~~~~~
/wrkdirs/usr/ports/graphics/opensubdiv/work/OpenSubdiv-3_4_3/opensubdiv/hbr/../hbr/mesh.h:224:31: error: assigning to 'OpenSubdiv::v3_4_3::HbrMemStatFunction' (aka 'void (*)(unsigned int)') from incompatible type 'void (*)(unsigned long)': type mismatch at 1st parameter ('size_t' (aka 'unsigned int') vs 'unsigned long')
        s_memStatsDecrement = decrement;

Full buid log is available here

@barfowl
Copy link
Collaborator

barfowl commented Jun 29, 2020

Thanks for pointing this out. I'm surprised other compilers are not generating similar errors/warnings on 32-bit systems.

These errors are coming from the Hbr branch of the library, which is not actively used in any of the core functionality (and has been discouraged since 3.0). It is still used in some old regression tests and tutorials, so you should be able to avoid these problems by building with -DNO_REGRESSION and -DNO_TUTORIALS.

If you do eventually make use of Hbr in your use of OpenSubdiv, though, you will run into this. Hbr can also generate a lot of warnings with newer, more stringent compilers. It's unclear how much future effort we'll put into dealing with issues coming from Hbr.

@sambler
Copy link
Author

sambler commented Jun 30, 2020

Yes, only the regression, example and tutorials are failing.

More specifically, failing code using hbr can be found in :-
examples/farViewer
tutorials/hbr
regression/hbr_regression
regression/far_regression
regression/osd_regression

@jtran56
Copy link

jtran56 commented Jul 2, 2020

Filed as internal issue #OSD-327.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants