AcademySoftwareFoundation / AcademySoftwareFoundation/openvdb

Compiler error on Visual Studio 2019

Open
#808 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
3.4k
Forks
774
Avg merge
3d 9h
Merged PRs (30d)
34

Description

Repro steps:
1. Get OpenVDB using vcpkg (command line I was using: "vcpkg install openvdb:x64-windows"
2. Run "vcpkg integrate install" to get vcpkg to includes/libs to be automatically picked up by Visual Studio
2. Compile anything with "#include " in VS 2019

The error I get is
"error C4146: unary minus operator applied to unsigned type, result still unsigned" coming from NodeMasks.h lines 112 and 134, code below:

return DeBruijn[Index32((v & -v) * 0x077CB531U) >> 27];

Easy fix would probably be to just cast it to an int and then cast it back to a uint after all is said and done

Contributor guide

Open the contributing guide

Research direction

Start with NodeMasks.h at the reported lines 112 and 134, then reproduce the issue by installing OpenVDB with vcpkg and compiling a file that includes openvdb/openvdb.h in Visual Studio 2019. Done means the reported C4146 error no longer occurs during compilation.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.