fix up build error ‘uintptr_t’ undeclared#16
Open
liuqun wants to merge 1 commit intoappnexus:masterfrom
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Build error is
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