Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implicit-function-declaration #1

Open
pavlinux opened this issue Jan 9, 2018 · 1 comment
Open

implicit-function-declaration #1

pavlinux opened this issue Jan 9, 2018 · 1 comment

Comments

@pavlinux
Copy link

pavlinux commented Jan 9, 2018

python setup.py install
running install
running build
running build_ext
building 'deep_spectre' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -g0 -ggdb0 -Ofast -mtune=native -march=native -mfpmath=sse -fexcess-precision=fast -fno-strict-aliasing --param l2-cache-size=2048 --param l1-cache-line-size=64 --param l1-cache-size=64 -D_FORTIFY_SOURCE=2 -fPIE -pie -fPIC -fstack-protector -Wl,-z,relro -Wl,-z,now -fPIC -I/usr/include/python2.7 -c deep_spectre.c -o build/temp.linux-x86_64-2.7/deep_spectre.o
deep_spectre.c: In function 'readMemoryByte':
deep_spectre.c:69:5: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
for (volatile int z = 0; z < 100; z++) {} /* Delay (can also mfence) /
^
deep_spectre.c:69:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
deep_spectre.c:85:23: warning: pointer targets in passing argument 1 of '__rdtscp' differ in signedness [-Wpointer-sign]
time1 = __rdtscp( & junk); /
READ TIMER */
^
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.9/include/x86intrin.h:27:0,
from deep_spectre.c:8:
/usr/lib/gcc/x86_64-linux-gnu/4.9/include/ia32intrin.h:112:1: note: expected 'unsigned int *' but argument is of type 'int *'
__rdtscp (unsigned int __A) ^
deep_spectre.c:87:23: warning: pointer targets in passing argument 1 of '__rdtscp' differ in signedness [-Wpointer-sign]
time2 = __rdtscp( & junk) - time1; /
READ TIMER & COMPUTE ELAPSED TIME */
^
In file included from /usr/lib/gcc/x86_64-linux-gnu/4.9/include/x86intrin.h:27:0,
from deep_spectre.c:8:
/usr/lib/gcc/x86_64-linux-gnu/4.9/include/ia32intrin.h:112:1: note: expected 'unsigned int *' but argument is of type 'int *'
__rdtscp (unsigned int __A)
^
deep_spectre.c: At top level:
deep_spectre.c:145:15: error: variable 'deep_spectre_module' has initializer but incomplete type
static struct PyModuleDef deep_spectre_module = {
^
deep_spectre.c:146:5: error: 'PyModuleDef_HEAD_INIT' undeclared here (not in a function)
PyModuleDef_HEAD_INIT,
^
deep_spectre.c:146:5: warning: excess elements in struct initializer
deep_spectre.c:146:5: warning: (near initialization for 'deep_spectre_module')
deep_spectre.c:147:5: warning: excess elements in struct initializer
"deep_spectre", /
name of module /
^
deep_spectre.c:147:5: warning: (near initialization for 'deep_spectre_module')
deep_spectre.c:148:5: warning: excess elements in struct initializer
NULL, /
module documentation, may be NULL /
^
deep_spectre.c:148:5: warning: (near initialization for 'deep_spectre_module')
deep_spectre.c:149:5: warning: excess elements in struct initializer
-1, /
size of per-interpreter state of the module,
^
deep_spectre.c:149:5: warning: (near initialization for 'deep_spectre_module')
deep_spectre.c:152:1: warning: excess elements in struct initializer
};
^
deep_spectre.c:152:1: warning: (near initialization for 'deep_spectre_module')
deep_spectre.c: In function 'PyInit_deep_spectre':
deep_spectre.c:156:5: warning: implicit declaration of function 'PyModule_Create' [-Wimplicit-function-declaration]
return PyModule_Create(&deep_spectre_module);
^
deep_spectre.c:156:5: warning: 'return' with a value, in function returning void
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

@asm
Copy link
Owner

asm commented Jan 10, 2018

The first thing I notice is you're attempting to use Python 2. I've only tested this with Python 3. See if switching to 3 fixes the issue. If not, I'm happy to dive into the syntax issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants