You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used Visual Studio 2017 to code and compile, and some of the properties went wrong when I set the Style property of YGNode and got the layout results.
When I looked at the definitions of YGStylet and YGLayout, I found that some of the properties were bitfields used. In this case, having this property causes a sign problem. For example, the value of flexDirection is [0,3], when the value is 2 or 3, the bit field that USES two bits will take the previous bit as the symbol, resulting in a negative value. Without experimenting with other compilers, there may not be such a problem, but in Visual Studio such a problem does exist. The properties found to have this problem exist in almost all the properties that use bit fields.
This is blocking my build when I try to import YGNode.h into a C++ context – the compiler errors with "Implicit truncation to bitfield will change value from 4 to -4." I tried changing the enum definition to be unsigned instead of int but that no workm.
Report
Issues and Steps to Reproduce
I used Visual Studio 2017 to code and compile, and some of the properties went wrong when I set the Style property of YGNode and got the layout results.
When I looked at the definitions of YGStylet and YGLayout, I found that some of the properties were bitfields used. In this case, having this property causes a sign problem. For example, the value of flexDirection is [0,3], when the value is 2 or 3, the bit field that USES two bits will take the previous bit as the symbol, resulting in a negative value. Without experimenting with other compilers, there may not be such a problem, but in Visual Studio such a problem does exist. The properties found to have this problem exist in almost all the properties that use bit fields.
Link to Code
https://github.com/facebook/yoga/blob/master/tests/YGFlexDirectionTest.cpp
This test won't work well in Visual Studio,
The text was updated successfully, but these errors were encountered: