Open paulsht opened 9 years ago
Full log:
1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1> Checking Build System
1> CMake does not need to re-run because D:/flann-1.8.4/build/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because D:/flann-1.8.4/build/cmake/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because D:/flann-1.8.4/build/src/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because D:/flann-1.8.4/build/src/cpp/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because D:/flann-1.8.4/build/src/matlab/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because D:/flann-1.8.4/build/src/python/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because D:/flann-1.8.4/build/examples/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because D:/flann-1.8.4/build/test/CMakeFiles/generate.stamp is up-to-date.
1> CMake does not need to re-run because D:/flann-1.8.4/build/doc/CMakeFiles/generate.stamp is up-to-date.
2>------ Rebuild All started: Project: flann_s, Configuration: Debug x64 ------
2> Building Custom Rule D:/flann-1.8.4/src/cpp/CMakeLists.txt
2> CMake does not need to re-run because D:\flann-1.8.4\build\src\cpp\CMakeFiles\generate.stamp is up-to-date.
2> flann.cpp
2>D:\flann-1.8.4\src\cpp\flann/algorithms/kmeans_index.h(342): warning C4291: 'void operator new(size_t,flann::PooledAllocator &)' : no matching operator delete found; memory will not be freed if initialization throws an exception
2> D:\flann-1.8.4\src\cpp\flann/util/allocator.h(197) : see declaration of 'operator new'
2> D:\flann-1.8.4\src\cpp\flann/algorithms/kmeans_index.h(332) : while compiling class template member function 'void flann::KMeansIndex
Any help here?
Is there a problem with the functionality? I'm not familiar with the code, however this seems like an overzealous compiler warning.
It builds successfully. But problem may occur later in runtime when it is not expected. Project should compile without any warning.
I used latest flann-1.8.4 generated from supplied CMake files.
I do not agree. Different compilers will generate different warnings, often based on assumptions. While the warnings might be usefull for the developer to point out potential problems, it may just be that the developer coding style is incompatible with the compilers assumptions. It might also be, that the code in question is written as is by design and not by mistake. PS: It's a warning rather than an error for a reason.
Interesting what contributors will say.
In 'flann / src / cpp / flann / util / allocator.h' the PooledAllocator overloads the new operator. Instead of reserving the data for each new element, a large block of data is reserved and than divided as needed. There is not individual delete. The whole block is deleted, when the PooledAllocator is destroyed.
Also, the object Node (beeing created with new) seems to use the default constructor, there is not reason it would throw an exeption.
The warning is a result of VS wanting a delete with every new operator, not understanding that there is no delete by desing.
I'm sorry about turning this into a discussion.
Thank you for your detailed explanation. Maybe I will be able to fix it myself.
Seems flann authors don't plan to support Visual Studio.
A way to "fix" it, would be to add a dummy delete operator. However it is a pointless exercise.
You might be on track of a greater issue. Visual Studio seems to be adding some modifications to the code, that are beyond optimization. For a highly performance optimized library such as FLANN this might be a problem. If you really want to solve this issue, look at how to tell VS to simply compile the project as a standard C++ compiler.
Hi!
When compiling flann on Visual Studio 2013 64 bit project, I have a lot occurrences (10) of same warning:
1>....\flann-1.8.4\src\cpp\flann/algorithms/kmeans_index.h(342): warning C4291: 'void *operator new(size_t,flann::PooledAllocator &)' : no matching operator delete found; memory will not be freed if initialization throws an exception
Is there way to fix it?