Skip to content

Fix macros VA_ARGS#33

Open
Loki-Astari wants to merge 1 commit intoYasserAsmi:masterfrom
Loki-Astari:master
Open

Fix macros VA_ARGS#33
Loki-Astari wants to merge 1 commit intoYasserAsmi:masterfrom
Loki-Astari:master

Conversation

@Loki-Astari
Copy link
Copy Markdown

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.

    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
Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant