jvar
jvar copied to clipboard
Fix macros VA_ARGS
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.
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.