Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1.10.x | backport] Fix -Wgnu-zero-variadic-macro-arguments in GMock #2866

Conversation

DenizThatMenace
Copy link

Passing zero arguments to the variadic part of a macro is a GNU extension and triggers warnings when build projects using GMock with -pedantic.

  • Fix uses of GMOCK_PP_INTERNAL_INTERNAL_16TH to always receive at least 17 arguments. (This was triggered when GMOCK_PP_NARG or GMOCK_PP_HAS_COMMA were used with an argument containing no commas).
  • Fix GMOCK_PP_HEAD to append a dummy unused argument so that GMOCK_PP_INTERNAL_HEAD_CAT always has two arguments.

(backport of commit a09ea70)

Passing zero arguments to the variadic part of a macro is a GNU
extension and triggers warnings when build projects using GMock with
`-pedantic`.

 - Fix uses of `GMOCK_PP_INTERNAL_INTERNAL_16TH` to always receive at
least 17 arguments. (This was triggered when `GMOCK_PP_NARG` or
`GMOCK_PP_HAS_COMMA` were used with an argument containing no commas.)
 - Fix `GMOCK_PP_HEAD` to append a dummy unused argument so that
`GMOCK_PP_INTERNAL_HEAD_CAT` always has two arguments.

(backport of commit a09ea70)
@derekmauro
Copy link
Member

Unfortunately we can't just accept backports for arbitrary issues into our releases. We will fix genuine bugs, but this is just a compile warning. Release stability is important. If you want the latest and greatest fixes, just use the master branch.

@derekmauro derekmauro closed this Jun 2, 2020
@DenizThatMenace
Copy link
Author

This is not an "arbitrary issue". It is a hard compilation error for users enabling the "-pedantic-errors" (GCC) compiler option.

This pull-request is no different than the former (latest) pull-request (#2723) accepted for this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants