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

make error #1

Closed
hackendltd opened this issue Mar 14, 2020 · 2 comments
Closed

make error #1

hackendltd opened this issue Mar 14, 2020 · 2 comments

Comments

@hackendltd
Copy link

os: centos 6.7 x86_64

[root@Father-master]# make
gcc -Wall -ldl -o rk.so -fPIC -shared -D_GNU_SOURCE father.c
father.c:128: error: conflicting types for ‘restrict’
father.c:128: note: previous definition of ‘restrict’ was here
father.c:129: error: expected ‘;’, ‘,’ or ‘)’ before ‘path’
make: *** [father] Error 1

@hackendltd
Copy link
Author

os:centos7 elrepo kernel
[root@Father]# make
gcc -Wall -ldl -o rk.so -fPIC -shared -D_GNU_SOURCE father.c
father.c:128:51: error: conflicting types for ‘restrict’
int (*o_lstat)(const char *restrict, struct stat *restrict);
^
father.c:128:28: note: previous definition of ‘restrict’ was here
int (*o_lstat)(const char *restrict, struct stat *restrict);
^
father.c:129:32: error: expected ‘;’, ‘,’ or ‘)’ before ‘path’
int lstat(const char *restrict path, struct stat *restrict buf) {
^
make: *** [father] Error 1

@mav8557
Copy link
Owner

mav8557 commented Oct 24, 2020

CentOS 7's shipped GCC (version 4.8.5) does not support the restrict keyword. You'll have to either remove that from the code or use a more recent GCC version.

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