mirror of https://github.com/xemu-project/xemu.git
configure: fix double check tests with Clang
Configuring with Clang compiler with -Werror would not work after improved checks: /tmp/qemu-conf--25992-.c:4:32: error: self-comparison always evaluates to true [-Werror,-Wtautological-compare] int main(void) { return preadv == preadv; } /tmp/qemu-conf--25992-.c:13:26: error: self-comparison always evaluates to true [-Werror,-Wtautological-compare] return epoll_create1 == epoll_create1; /tmp/qemu-conf--25992-.c:3:13: error: explicitly assigning a variable of type 'char **' to itself [-Werror,-Wself-assign] environ = environ; Avoid the errors by adjusting the tests. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
8dc38a78d0
commit
c075a72399
|
@ -2256,7 +2256,7 @@ cat > $TMPC <<EOF
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
int main(void) { return preadv == preadv; }
|
int main(void) { return preadv(0, 0, 0, 0); }
|
||||||
EOF
|
EOF
|
||||||
preadv=no
|
preadv=no
|
||||||
if compile_prog "" "" ; then
|
if compile_prog "" "" ; then
|
||||||
|
@ -2552,7 +2552,7 @@ int main(void)
|
||||||
* warning but not an error, and will proceed to fail the
|
* warning but not an error, and will proceed to fail the
|
||||||
* qemu compile where we compile with -Werror.)
|
* qemu compile where we compile with -Werror.)
|
||||||
*/
|
*/
|
||||||
return epoll_create1 == epoll_create1;
|
return (int)(uintptr_t)&epoll_create1;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
if compile_prog "" "" ; then
|
if compile_prog "" "" ; then
|
||||||
|
@ -2945,7 +2945,7 @@ has_environ=no
|
||||||
cat > $TMPC << EOF
|
cat > $TMPC << EOF
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
int main(void) {
|
int main(void) {
|
||||||
environ = environ;
|
environ = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Reference in New Issue