Bug#805211: libffado: FTBFS: error: function ‘int* __errno_location()’ is initialized like a variable
Source: libffado
Followup-For: Bug #805211
Dear Maintainer,
In several of the tests in this package 'errno' is declared as an
int. However, errno is provided by the c runtime and may be a macro so
declaring it again as an int is an error. This is breaking the build on,
at least, sparc64. Fortunately the fix is simple: change the errno
declaration to an 'extern'. Removing the entire 'int errno' declaration
and including <cerrno> would work as well.
Included is a patch that changes the declarations:
int errno = 0;
to
extern int errno;
This allows the package to build on sparc64 and doesn't break the build
on other archs.
Thanks!
David
-- System Information:
Debian Release: stretch/sid
APT prefers unreleased
APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: sparc64
Kernel: Linux 4.3.0-gentoo (SMP w/1 CPU core)
Locale: LANG=en_SG.UTF-8, LC_CTYPE=en_SG.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect
--- a/tests/test-enhanced-mixer.cpp
+++ b/tests/test-enhanced-mixer.cpp
@@ -77,7 +77,7 @@
exit(0);
}
- int errno = 0;
+ extern int errno;
char* tail;
int node_id = strtol( argv[1], &tail, 0 );
int fb_id = strtol( argv[2], &tail, 0 );
--- a/tests/test-mixer.cpp
+++ b/tests/test-mixer.cpp
@@ -227,7 +227,7 @@
exit(0);
}
- int errno = 0;
+ extern int errno;
char* tail;
int port = strtol( argv[1], &tail, 0 );
int node_id = strtol( argv[2], &tail, 0 );
--- a/tests/test-pan.cpp
+++ b/tests/test-pan.cpp
@@ -131,7 +131,7 @@
exit(0);
}
- int errno = 0;
+ extern int errno;
char* tail;
int node_id = strtol( argv[1], &tail, 0 );
int fb_id = strtol( argv[2], &tail, 0 );
--- a/tests/test-volume.cpp
+++ b/tests/test-volume.cpp
@@ -127,7 +127,7 @@
exit(0);
}
- int errno = 0;
+ extern int errno;
char* tail;
int node_id = strtol( argv[1], &tail, 0 );
int fb_id = strtol( argv[2], &tail, 0 );
Reply to: