oneTBB icon indicating copy to clipboard operation
oneTBB copied to clipboard

Compiling errors while building with mingw gcc 13.2.0

Open someoneinjd opened this issue 1 year ago • 1 comments

The following error occurs when building the latest tbb with mingw gcc 13.2.0:

C:\Users\Test\oneTBB\src\tbb\dynamic_link.cpp: In function 'void tbb::detail::r1::dynamic_unlink(dynamic_link_handle)':
C:\Users\Test\oneTBB\src\tbb\dynamic_link.cpp:37:39: error: value computed is not used [-Werror=unused-value]
   37 |     #define dlclose( handle )       ( ! FreeLibrary( handle ) )
      |                                     ~~^~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Test\oneTBB\src\tbb\dynamic_link.cpp:370:13: note: in expansion of macro 'dlclose'
  370 |             dlclose( handle );
      |             ^~~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus.exe: all warnings being treated as errors

A workable fix is as follows:

--- a/src/tbb/dynamic_link.cpp
+++ b/src/tbb/dynamic_link.cpp
@@ -367,7 +367,7 @@ namespace r1 {
         if ( !dlclose ) return;
     #endif
         if ( handle ) {
-            dlclose( handle );
+            (void)dlclose( handle );
         }
     }

someoneinjd avatar Feb 18 '24 09:02 someoneinjd

Thanks for providing the fix. We will create a patch to review.

sarathnandu avatar Feb 21 '24 17:02 sarathnandu