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

clang's variadic macro warnings: only for clang #3132

Merged

Conversation

yopito
Copy link
Contributor

@yopito yopito commented Apr 14, 2021

following settings of cmake/modules/Warnings.cmake

once applied, no more zillon of warning on building as below:

cc1plus: note: unrecognized command-line option '-Wno-gnu-zero-variadic-macro-arguments' may have been intended to silence earlier diagnostics

Edit: appeared on 3.1.3 or 3.2 release

@yopito yopito changed the title clang's variadic macro warnings: only for clang [stable-3.2] clang's variadic macro warnings: only for clang Apr 14, 2021
@FlexW
Copy link

FlexW commented Apr 15, 2021

Thanks. Could you do it in a little bit different way, so that the flags get not set globally. Paste this

# Calling Qt's qCWarning(category, ...) with no params for "..." is a GNU
# extension (C++11 §16.3/4 forbids them). Silence clang's warnings.
target_compile_options("${csync_NAME}" PUBLIC
  $<$<CXX_COMPILER_ID:Clang>:-Wno-gnu-zero-variadic-macro-arguments>
  $<$<C_COMPILER_ID:Clang>:-Wno-gnu-zero-variadic-macro-arguments>)

right below add_library("${csync_NAME}" ...) in src/csync/CMakeLists.txt.

Then remove

  # Calling Qt's qCWarning(category, ...) with no params for "..." is a GNU
  # extension (C++11 §16.3/4 forbids them). Silence clang's warnings.
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")

entirely from src/CMakeLists.txt.

Additionally it would be great if you can signoff your commit to please the DCO bot.

# extension (C++11 §16.3/4 forbids them). Silence clang's warnings.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-gnu-zero-variadic-macro-arguments")
endif()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment

@yopito
Copy link
Contributor Author

yopito commented Apr 15, 2021

hello @FlexW : thanks for your inputs.
I don't feel confident to apply your changes: I don't understand them, not fluent enough in cmake.
Would you patch it on you own (PR) ?

@FlexW
Copy link

FlexW commented Apr 16, 2021

@yopito Yes, I can do it. But thinking a bit more about this, I'm not sure anymore if that is the best way to solve the problem. I have the feeling that setting this warning should be a private property and not automatically should change the flags on all targets that link to the csync target. However, if making it private, we need to set it on each target separate. @mgallien What do you think?

@er-vin
Copy link
Member

er-vin commented Apr 21, 2021

By the way, would that be more appropriate to do that in master and backport? So far the project followed a backport strategy not a forward port one.

@FlexW
Copy link

FlexW commented Apr 22, 2021

By the way, would that be more appropriate to do that in master and backport? So far the project followed a backport strategy not a forward port one.

Of course that would be better :) Thanks for hinting it.

@yopito yopito force-pushed the fix/clang-variadic-macro-warning-only-for-clang branch from 5295182 to c918359 Compare April 23, 2021 22:12
@yopito yopito changed the base branch from stable-3.2 to master April 23, 2021 22:13
@yopito
Copy link
Contributor Author

yopito commented Apr 23, 2021

OK, I've reworked this PR against master branch.
Have to "signoff commit to please the DCO bot"

@yopito yopito force-pushed the fix/clang-variadic-macro-warning-only-for-clang branch from c918359 to 687a9cf Compare April 23, 2021 22:17
@yopito yopito changed the title [stable-3.2] clang's variadic macro warnings: only for clang clang's variadic macro warnings: only for clang Apr 23, 2021
Copy link

@FlexW FlexW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I'll will merge that now as it is.

@FlexW
Copy link

FlexW commented Apr 26, 2021

/rebase

following settings of cmake/modules/Warnings.cmake

Signed-off-by: yopito <pierre.bourgin@free.fr>
@github-actions github-actions bot force-pushed the fix/clang-variadic-macro-warning-only-for-clang branch from 687a9cf to 14d61c5 Compare April 26, 2021 13:22
@nextcloud-desktop-bot
Copy link

AppImage file: Nextcloud-PR-3132-14d61c507157cc0c45201f934255c6dde03f64fc-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@FlexW FlexW merged commit 5ea16ff into nextcloud:master Apr 26, 2021
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.

None yet

4 participants