Skip to content

Tests use GNU C extensions and fail to compile #43

@thomwiggers

Description

@thomwiggers
gcc -O3      -std=c11 -fsanitize=undefined,address -march=native -D _AMD64_ -D __NIX__ -D _FAST_ -D _MULX_ -D _ADX_ -L./lib434 tests/arith_tests-p434.c tests/test_extras.c -lsidh -lm -o arith_tests-p434
tests/test_extras.c: In function ‘cpucycles’:
tests/test_extras.c:37:5: error: ‘asm’ undeclared (first use in this function)
   37 |     asm volatile ("rdtsc\n\t" : "=a" (lo), "=d"(hi));
      |     ^~~
tests/test_extras.c:37:5: note: each undeclared identifier is reported only once for each function it appears in
tests/test_extras.c:37:8: error: expected ‘;’ before ‘volatile’
   37 |     asm volatile ("rdtsc\n\t" : "=a" (lo), "=d"(hi));
      |        ^~~~~~~~~
      |        ;

If you use -std=gnu11, these errors go away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions