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

fix up build error ‘uintptr_t’ undeclared #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

liuqun
Copy link

@liuqun liuqun commented Nov 24, 2019

Build error is

[ 66%] Building C object test/CMakeFiles/check_an_array.dir/check_an_array.c.o
In file included from /home/liuqun/Desktop/acf/test/check_an_array.c:2:0:
/home/liuqun/Desktop/acf/test/check_an_array.c: In function ‘stack_generic’:
/home/liuqun/Desktop/acf/test/check_an_array.c:80:12: error: ‘uintptr_t’ undeclared (first use in this function)
   fail_if((uintptr_t)cursor->value != (uintptr_t)i++);
            ^
/home/liuqun/Desktop/acf/test/check_an_array.c:80:12: note: each undeclared identifier is reported only once for each function it appears in
/home/liuqun/Desktop/acf/test/check_an_array.c:80:22: error: expected ‘)’ before ‘cursor’
   fail_if((uintptr_t)cursor->value != (uintptr_t)i++);
                      ^
/home/liuqun/Desktop/acf/test/check_an_array.c:85:22: error: expected ‘)’ before ‘cursor’
   fail_if((uintptr_t)cursor->value != (uintptr_t)i++);
                      ^
/home/liuqun/Desktop/acf/test/check_an_array.c:94:22: error: expected ‘)’ before ‘n’
   fail_if((uintptr_t)n->value != (uintptr_t)i - 1);
                      ^
/home/liuqun/Desktop/acf/test/check_an_array.c:90:16: error: variable ‘n’ set but not used [-Werror=unused-but-set-variable]
   struct node *n;
                ^
/home/liuqun/Desktop/acf/test/check_an_array.c:70:15: error: variable ‘cursor’ set but not used [-Werror=unused-but-set-variable]
  struct node *cursor;
               ^
cc1: all warnings being treated as errors

Bug found in CentOS 7.7(and 7.6) with its default gcc 4.x:

yum install gcc check-devel epel-release && yum install cmake3

Tested in CentOS 7.x

[ 66%] Building C object test/CMakeFiles/check_an_array.dir/check_an_array.c.o
In file included from /home/liuqun/Desktop/acf/test/check_an_array.c:2:0:
/home/liuqun/Desktop/acf/test/check_an_array.c: In function ‘stack_generic’:
/home/liuqun/Desktop/acf/test/check_an_array.c:80:12: error: ‘uintptr_t’ undeclared (first use in this function)
   fail_if((uintptr_t)cursor->value != (uintptr_t)i++);
            ^
/home/liuqun/Desktop/acf/test/check_an_array.c:80:12: note: each undeclared identifier is reported only once for each function it appears in
/home/liuqun/Desktop/acf/test/check_an_array.c:80:22: error: expected ‘)’ before ‘cursor’
   fail_if((uintptr_t)cursor->value != (uintptr_t)i++);
                      ^
/home/liuqun/Desktop/acf/test/check_an_array.c:85:22: error: expected ‘)’ before ‘cursor’
   fail_if((uintptr_t)cursor->value != (uintptr_t)i++);
                      ^
/home/liuqun/Desktop/acf/test/check_an_array.c:94:22: error: expected ‘)’ before ‘n’
   fail_if((uintptr_t)n->value != (uintptr_t)i - 1);
                      ^
/home/liuqun/Desktop/acf/test/check_an_array.c:90:16: error: variable ‘n’ set but not used [-Werror=unused-but-set-variable]
   struct node *n;
                ^
/home/liuqun/Desktop/acf/test/check_an_array.c:70:15: error: variable ‘cursor’ set but not used [-Werror=unused-but-set-variable]
  struct node *cursor;
               ^
cc1: all warnings being treated as errors
@coveralls
Copy link

Coverage Status

Coverage remained the same at 93.506% when pulling bd7669b on liuqun:test-include-stdint-h into 4ac4618 on appnexus:master.

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

Successfully merging this pull request may close these issues.

2 participants