Ns-3.41 errata

From Nsnam
Jump to: navigation, search

On February 9, 2024, ns-3.41 was published. This page lists some issues that have been fixed in the mainline since that time. If considered impactful enough, the maintainers may make an update to this release to cover some or all of these issues.

Build failure on macOS clang 15.0.0 (Xcode 15.3)

Recent Xcode updates (to version 15.3) started to trigger a test compilation failure:

 /tmp/ns-3-dev/src/core/test/attribute-container-test-suite.cc:310:13: error: use of overloaded operator '==' is ambiguous (with operand types 'const value_type' (aka 'const pair<const std::string, long long>') and 'result_type' (aka 'pair<std::string, long long>'))
           NS_TEST_ASSERT_MSG_EQ(v, (*aciter)->Get(), "Incorrect value");
           ^17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)
 /tmp/ns-3-dev/src/core/model/test.h:147:24: note: expanded from macro 'NS_TEST_ASSERT_MSG_EQ'
       if (!((actual) == (limit)))                                                                \
             17:20, 19 May 2024 (UTC)Tom (talk) ^  17:20, 19 May 2024 (UTC)~~
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__utility/pair.h:611:1: note: candidate function [with _T1 = const std::string, _T2 = long long, _U1 = std::string, _U2 = long long]
 operator==(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
 ^
 /tmp/ns-3-dev/src/core/test/attribute-container-test-suite.cc:207:1: note: candidate function [with A = const std::string, B = long long, C = std::string, D = long long]
 operator==(const std::pair<A, B>& x, const std::pair<C, D>& y)
 ^
 /tmp/ns-3-dev/src/core/test/attribute-container-test-suite.cc:545:13: error: use of overloaded operator '==' is ambiguous (with operand types 'const value_type' (aka 'const pair<const std::string, int>') and 'value_type' (aka 'pair<const std::string, int>'))
           NS_TEST_ASSERT_MSG_EQ(v, *iter, "Incorrect value in mapstrint");
           ^17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)17:20, 19 May 2024 (UTC)~~
 /tmp/ns-3-dev/src/core/model/test.h:147:24: note: expanded from macro 'NS_TEST_ASSERT_MSG_EQ'
       if (!((actual) == (limit)))                                                                \
             17:20, 19 May 2024 (UTC)Tom (talk) ^  17:20, 19 May 2024 (UTC)~~
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/include/c++/v1/__utility/pair.h:611:1: note: candidate function [with _T1 = const std::string, _T2 = int, _U1 = const std::string, _U2 = int]
 operator==(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
 ^
 /tmp/ns-3-dev/src/core/test/attribute-container-test-suite.cc:207:1: note: candidate function [with A = const std::string, B = int, C = const std::string, D = int]
 operator==(const std::pair<A, B>& x, const std::pair<C, D>& y)
 ^
 2 errors generated.

This is only observed when enabling tests in the build (--enable-tests).

The following patch to the source code can be applied as a workaround, or ns-3-dev may be used, or tests can be disabled:

Build failure on macOS version 14.3.1 or greater

A compilation error may be observed (sometimes in normal builds, sometimes only when clang-tidy is enabled) for macOS versions 14.3.1 or greater (Apple clang version 15.0.0 (clang-1500.1.0.2.5)).

 /Users/user/ns-3-dev/src/core/test/attribute-container-test-suite.cc:310:13: error: use of overloaded operator '==' is 
 ambiguous (with operand types 'const value_type' (aka 'const pair<const std::string, long long>') and 'result_type' (aka 'pair<std::string, 
 long long>'))
           NS_TEST_ASSERT_MSG_EQ(v, (*aciter)->Get(), "Incorrect value");
           ^23:19, 8 March 2024 (UTC)23:19, 8 March 2024 (UTC)23:19, 8 March 2024 (UTC)23:19, 8 March 2024 (UTC)23:19, 8 March 2024 (UTC)23:19, 8 March 2024 (UTC)23:19, 8 March 2024 (UTC)23:19, 8 March 2024 (UTC)23:19, 8 March 2024 (UTC)23:19, 8 March 2024 (UTC)23:19, 8 March 2024 (UTC)23:19, 8 March 2024 (UTC)
 /Users/user/ns-3-dev/src/core/model/test.h:147:24: note: expanded from macro 'NS_TEST_ASSERT_MSG_EQ'
       if (!((actual) == (limit)))                                                                \
             23:19, 8 March 2024 (UTC)Tom (talk) ^  23:19, 8 March 2024 (UTC)~~
 /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/include/c++/v1/__utility/pair.h:611:1: note: candidate function [with _T1 = const 
 std::string, _T2 = long long, _U1 = std::string, _U2 = long long]
 operator==(const pair<_T1,_T2>& __x, const pair<_U1,_U2>& __y)
 ^
 /Users/user/ns-3-dev/src/core/test/attribute-container-test-suite.cc:207:1: note: candidate function [with A = const std::string, B = long 
 long, C = std::string, D = long long]
 operator==(const std::pair<A, B>& x, const std::pair<C, D>& y)
 ^

This is only observed when enabling tests in the build (--enable-tests).

The following patch to the source code can be applied as a workaround, or ns-3-dev may be used, or tests can be disabled: