oneTBB
oneTBB copied to clipboard
Compiling errors while building with mingw gcc 13.2.0
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 );
}
}
Thanks for providing the fix. We will create a patch to review.