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

Silence assert redefinition warning #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/testutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ void exit(int __status)

#define RUN_TEST(fun) __run_test(fun, #fun);
#define END_TEST() __print_test_result(__FILE__);

// temporarily silence clang warnings about assert redefinition
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmacro-redefined"

#define __assert(c) do { \
if (!(c)) { \
fprintf(stderr, "Assertion error '%s' in %s:%d\n", #c, __FILE__, __LINE__); \
Expand All @@ -64,6 +69,8 @@ void exit(int __status)

#define assert(c) __assert(c);

#pragma clang diagnostic pop

void steps(ijvm* m, int n);

static int __passed_test_counter = 0;
Expand Down