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

Compilation fails on TCC #97

Open
dargueta opened this issue Sep 9, 2023 · 0 comments
Open

Compilation fails on TCC #97

dargueta opened this issue Sep 9, 2023 · 0 comments

Comments

@dargueta
Copy link

dargueta commented Sep 9, 2023

Compilation fails on TinyC (TCC) because of a C99 feature it apparently doesn't support:

tcc  -I./src   -Wall -Wextra -Werror -std=c99 -O0 -g -c -I./tests -o tests/main.o tests/main.c
In file included from tests/main.c:3:
tests/munit/munit.h:401: error: 'size' undeclared
make: *** [Makefile:124: tests/main.o] Error 1

The troublesome line:

void munit_rand_memory(size_t size, munit_uint8_t buffer[MUNIT_ARRAY_PARAM(size)]);

This is the macro definition:

#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__PGI)
#  define MUNIT_ARRAY_PARAM(name) name
#else
#  define MUNIT_ARRAY_PARAM(name)
#endif

If we ensure __TINYC__ is undefined, it compiles.

#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__PGI) && !defined(__TINYC__)
//                                                                                ^^^^^^^^^^^^^^^^^^^^^^
dargueta added a commit to dargueta/munit that referenced this issue Sep 11, 2023
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

1 participant