Build failure on mingw-64
test.exe build error: undefined reference to sscanf (gcc 5.3.0 x86_64-w64-mingw32 with -flto enabled)
[https://gitweb.torproject.org/tor.git/tree/src/test/test_util.c#n4667]
test/test_util.c line 4667: int n = sscanf(contents, "%lu\n%c", &pid, &c);
Need tor_sscanf
Trac:
Username: bc348
- Show closed items
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- Trac changed milestone to %Tor: 0.2.9.x-final
changed milestone to %Tor: 0.2.9.x-final
diff --git b/src/test/test_util.c a/src/test/test_util.c index 2726c31..c3c6035 100644 --- b/src/test/test_util.c +++ a/src/test/test_util.c @@ -4664,7 +4664,7 @@ test_util_writepid(void *arg) contents = read_file_to_str(fname, 0, NULL); tt_assert(contents); - int n = sscanf(contents, "%lu\n%c", &pid, &c); + int n = tor_sscanf(contents, "%lu\n%c", &pid, &c); tt_int_op(n, OP_EQ, 1); #ifdef _WIN32
Trac:
Status: new to needs_review
Component: Core Tor to Core Tor/TorAnother instance
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c index e6b250a..c128333 100644 --- a/src/test/test_crypto.c +++ b/src/test/test_crypto.c @@ -162,7 +162,7 @@ test_crypto_openssl_version(void *arg) tt_assert(!strcmpstart(version, h_version)); /* "-fips" suffix, etc */ tt_assert(!strstr(version, "OpenSSL")); int a=-1,b=-1,c=-1; - sscanf(version, "%d.%d.%d", &a,&b,&c); + tor_sscanf(version, "%d.%d.%d", &a,&b,&c); tt_int_op(a, OP_GE, 0); tt_int_op(b, OP_GE, 0); tt_int_op(c, OP_GE, 0);
Strange -- I agree that we should be using tor_sscanf, even in the tests, but isn't sscanf supposed to be in libc?
Trac:
Keywords: N/A deleted, 028-backport added
Points: N/A to .1
Milestone: N/A to Tor: 0.2.9.x-finalReplying to nickm:
Strange -- I agree that we should be using tor_sscanf, even in the tests, but isn't sscanf supposed to be in libc? It seems mingw-w64 does not have an implementation for the scanf family [0].
[0] https://sourceforge.net/p/mingw-w64/wiki2/printf%20and%20scanf%20family/
Okay, changes applied to 0.2.7, 0.2.8, 0.2.9 as appropriate.
Trac:
Status: needs_review to closed
Actualpoints: N/A to 0
Resolution: N/A to fixed
Reviewer: N/A to nickmTrac:
Summary: Build failure to Build failure on mingw-64- Trac closed
closed
- Trac changed time estimate to 48m
changed time estimate to 48m
- Trac moved to tpo/core/tor#19213 (closed)
moved to tpo/core/tor#19213 (closed)