Evan Haas

Results 63 issues of Evan Haas

If `##` appears between a comma and `__VA_ARGS__` in a function-like macro, and the variable argument is omitted, the comma will be deleted in the expansion: ```c #define eprintf(format, ...)...

enhancement

Description here https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html clang only supports this in C++ mode with `-std=c++2a`. gcc supports it in all C standards but issues a pedantic warning `warning: __VA_OPT__ is not available until...

enhancement

```c void foo(int x, int y[static x]) { } ```` There should be no warning, arocc warns: ``` ./test.c:1:23: warning: 'static' useless without a constant size void foo(int x, int...

bug

```c void foo(int x[static 10]) { } void bar(void) { int x[5]; foo(x); } ``` clang warns: ``` test.c:7:5: warning: array argument is too small; contains 5 elements, callee requires...

enhancement

The following is not accepted but should be: ```C void foo(x) int x[static 5]; { } ``` ``` ./test.c:2:10: error: 'static' used outside of function parameters int x[static 5]; ^...

bug

Example taken from here: https://jadlevesque.github.io/PPMP-Iceberg/explanations#codeevaldefercode ```c #define EMPTY() #define LOOP_INDIRECTION() LOOP #define LOOP(x) x LOOP_INDIRECTION EMPTY()() (x) LOOP(1) ``` clang and gcc expand this to `1 LOOP_INDIRECTION () (1)` aro...

bug

This is undefined behavior according to the C standard but both gcc and clang treat it like `defined` is a function-like macro: ```c #define FOO_IS_DEFINED defined(FOO) #define FOO #if FOO_IS_DEFINED...

enhancement

arocc currently issues a warning for this; clang and gcc do not: ```c int foo(int x) { while (1) { return x; } } ```

enhancement

This currently gives a warning when it shouldn't: ```c void foo(const void *arg) { const char * const p1 = (const char * const)arg; } ``` ``` ./test.c:2:27: warning: cast...

enhancement

I have this simple python script to generate a C file with a lot of structs: ```python import sys for i in range(int(sys.argv[1])): print(f"struct S{i} {{int x; int y; int...

enhancement