jvar icon indicating copy to clipboard operation
jvar copied to clipboard

Fix macros VA_ARGS

Open Loki-Astari opened this issue 7 years ago • 1 comments

Using ... with zero arguments is non standard.
Fixed the use case.

Done by injecting an extra argument so that there is always at least one.
In these case add the empty string. Then append "%s" to the format.
The result should be the same. But the code is standard compliant.

Loki-Astari avatar Sep 05 '18 16:09 Loki-Astari

Hi I am trying to create a replacement for https://github.com/miloyip/nativejson-benchmark as Milo is not maintaining his version.

My testing framework is here: https://github.com/Loki-Astari/JsonBenchmark With the results being generated to here: http://lokiastari.com/Json/Performance.html

I am currently trying to add jvar to the tests but can't because the code generates the error:

    error: token pasting of ',' and __VA_ARGS__ is a GNU extension [-Werror,-Wgnu-zero-variadic-macro-arguments]

The above fix should make your code standards compliant and allow me to include it in the test.

Loki-Astari avatar Sep 05 '18 16:09 Loki-Astari