Skip to content

Compilation fails on TCC #97

@dargueta

Description

@dargueta

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__)
//                                                                                ^^^^^^^^^^^^^^^^^^^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions