Skip to content

Commit 507619b

Browse files
committed
Fix warnings in testdependencies
1 parent 3b1d9ef commit 507619b

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

tests/integration/testdependencies/dependency.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#include "dependency.h"
22
#include <malloc.h>
3+
#include <stdlib.h>
4+
#include <stdint.h>
35

46
int dep_run()
57
{
68
#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 17)
7-
return (int)secure_getenv("NON_EXISTING_ENV_VARIABLE");
9+
return (int)(intptr_t)secure_getenv("NON_EXISTING_ENV_VARIABLE");
810
#elif defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
911
return malloc_info(0, stdout);
1012
#else

tests/integration/testdependencies/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from os import path
44
from os import getenv
55

6-
cmd = 'gcc -shared -fPIC dependency.c -o libdependency.so'
6+
cmd = 'gcc -shared -fPIC -D_GNU_SOURCE dependency.c -o libdependency.so'
77
subprocess.check_call(cmd.split())
88

9-
define_macros = []
9+
define_macros = [('_GNU_SOURCE', None)]
1010
libraries = []
1111
library_dirs = []
1212

tests/integration/testdependencies/testdependencies.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#include "dependency.h"
33
#else
44
#include <malloc.h>
5+
#include <stdlib.h>
6+
#include <stdint.h>
57
#endif
68
#include <Python.h>
79

@@ -16,7 +18,7 @@ run(PyObject *self, PyObject *args)
1618
#ifdef WITH_DEPENDENCY
1719
res = dep_run();
1820
#elif defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 17)
19-
res = (int)secure_getenv("NON_EXISTING_ENV_VARIABLE");
21+
res = (int)(intptr_t)secure_getenv("NON_EXISTING_ENV_VARIABLE");
2022
#elif defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
2123
res = malloc_info(0, stdout);
2224
#else

0 commit comments

Comments
 (0)