Comments (7)
I've done a lot of recent updates for CodeQL warnings, so please retry with the latest version (I.e. the main branch) to see if this one is fixed.
from uvatlas.
I tried the main branch but still got the warnings.
from uvatlas.
If I understand correctly here, it's complaining about the difference between a uint64_t
and an int64_t
.
I don't know how it got there. m_dwVertNumber
is size_t
. memset
takes a size_t
per the standard. I thought size_t
was always unsigned and ptrdiff_t
was always signed. Per the standard, I thought sizeof
returns size_t, but I wonder if GNU is assuming it's int?
What's strange is the same pattern is used elsewhere and it doesn't complain elsewhere...
from uvatlas.
I just tried building with MinGW-w64 13.2.0 r4 and I'm not seeing these warnings.
from uvatlas.
OK, so they only show up in release builds. Not debug builds.
lto-wrapper.exe: warning: using serial compilation of 9 LTRANS jobs
lto-wrapper.exe: note: see the '-flto' option documentation for more information
In member function 'CalculateDijkstraPathToVertex',
inlined from 'CaculateDistanceToExtremeVertex' at D:/Microsoft/UVAtlas/UVAtlas/isochart/meshpartitionchart.cpp:1840:9,
inlined from 'CheckCylinderLonghornShape' at D:/Microsoft/UVAtlas/UVAtlas/isochart/meshpartitionchart.cpp:1740:5,
inlined from 'ProcessSpecialShape' at D:/Microsoft/UVAtlas/UVAtlas/isochart/meshpartitionchart.cpp:1640:5,
inlined from 'Partition' at D:/Microsoft/UVAtlas/UVAtlas/isochart/isochartmesh.cpp:797:29,
inlined from '_ZN8Isochart15CIsochartEngine36ParameterizeChartsInHeapParallelizedEby._omp_fn.0' at D:/Microsoft/UVAtlas/UVAtlas/isochart/isochartengine.cpp:322:47:
D:/Microsoft/UVAtlas/UVAtlas/isochart/isochartmesh.cpp:3350:11: warning: '__builtin_memset' specified size between 9223372036854775809 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
3350 | memset(pbVertProcessed, 0, sizeof(bool) * m_dwVertNumber);
| ^
In member function 'CalculateGeodesicDistanceToVertexKS98',
inlined from 'CalculateGeodesicDistanceToVertex' at D:/Microsoft/UVAtlas/UVAtlas/isochart/meshapplyisomap.cpp:475:46,
inlined from 'CalculateGeodesicDistance' at D:/Microsoft/UVAtlas/UVAtlas/isochart/meshapplyisomap.cpp:291:13:
D:/Microsoft/UVAtlas/UVAtlas/isochart/meshapplyisomap.cpp:565:11: warning: '__builtin_memset' specified size between 9223372036854775809 and 18446744073709551615 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
565 | memset(pbVertProcessed.get(), 0, sizeof(bool) * m_dwVertNumber);
| ^
D:/Microsoft/UVAtlas/UVAtlas/isochart/meshpartitionchart.cpp: In member function 'GenerateAllSubCharts':
D:/Microsoft/UVAtlas/UVAtlas/isochart/meshpartitionchart.cpp:32:119: warning: argument 1 value '18446744073709551615' exceeds maximum object size 9223372036854775807 [-Walloc-size-larger-than=]
32 | std::unique_ptr<std::vector<uint32_t>[]> chartFaceList(new (std::nothrow) std::vector<uint32_t>[dwMaxSubchartCount]);
|
^
C:/mingw64/include/c++/13.2.0/new:142:26: note: in a call to allocation function 'operator new []' declared here
142 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
from uvatlas.
According to some research here, GCC is actually complaining if it exceeds PTRDIFF_MAX - 1
which is the signed int vs. size_t which is an unsigned int.
It looks like a number of people feel this warning is spurious. Still, I'll see if I can make it happy. What I really don't understand is why it only complains in SOME of the cases which are all basically identical.
from uvatlas.
There is a page in the GCC manual about warning options at: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html .
I have to be honest in saying that I do feel that this is a spurious warning and from a practical point of view, it might be best to use a "hacky" but somewhat elegant fix for it that will work. The for loop I tied does work and I think SecureZeroMemory will also work if it's ifdefed out for Linux.
from uvatlas.
Related Issues (20)
- loading an obj doesnt work HOT 10
- Why 2 partitions in 1 iteration?
- Export UV map in Numpy format
- Why the number of vertices is increased? HOT 5
- How to make consistent UV atlases? HOT 1
- Retire VS 2017 support HOT 1
- ARM64 version of uvatlastool HOT 2
- UVAtlas exe stuck on 33.3% HOT 1
- How to compile UVAtlasTool under linux? HOT 4
- Why divided by f3dArea in IMT computation? HOT 1
- How to flatten a partitioned 3D mesh onto 2D UV map? HOT 17
- Non-deterministic UVAtlas parameterization HOT 4
- vertex correspondences saved in _map.txt look incorrect HOT 8
- uvatlastool generates additional vertices with already-unique faces HOT 2
- How to use the new texture coordinates (UV) generated by UVAtlas to render the 3D object? HOT 3
- [problem] UV triangles will overlap/conflict HOT 2
- Retire legacy Xbox One XDK support
- Issues building static library with vcpkg HOT 1
- Support macos? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uvatlas.