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

Suppress warning about missing noreturn attribute #549

Merged
merged 3 commits into from
Jul 22, 2017

Conversation

feroldi
Copy link
Contributor

@feroldi feroldi commented Jul 20, 2017

Adding [[noreturn]] to report_unknown_type suppresses the Clang/GCC -Wmissing-noreturn warning:

Clang outputs:

.../fmt/fmt/format.cc:294:74: warning:
      function 'report_unknown_type' could be declared with
      attribute 'noreturn' [-Wmissing-noreturn]
  ...code, const char *type) {
                             ^

GCC outputs:

.../fmt/fmt/format.cc:294:74: warning: function might be candidate for
    attribute 'noreturn' [-Wsuggest-attribute=noreturn]
  ...code, const char *type) {
                             ^

Mário Feroldi added 2 commits July 20, 2017 16:13
Adding `[[noreturn]]` to `report_unknown_type` suppresses the Clang/GCC `-Wmissing-noreturn` warning:

Clang outputs:

    .../fmt/fmt/format.cc:294:74: warning:
          function 'report_unknown_type' could be declared with
          attribute 'noreturn' [-Wmissing-noreturn]
      ...code, const char *type) {
                                 ^

GCC outputs:

    .../fmt/fmt/format.cc:294:74: warning: function might be candidate for
        attribute 'noreturn' [-Wsuggest-attribute=noreturn]
      ...code, const char *type) {
                                 ^
@vitaut
Copy link
Contributor

vitaut commented Jul 20, 2017

Thanks for the PR. Could you check why the MinGW build is failing (https://ci.appveyor.com/project/vitaut/fmt/build/build%20709)?

@vitaut vitaut merged commit d16c4d2 into fmtlib:master Jul 22, 2017
@vitaut
Copy link
Contributor

vitaut commented Jul 22, 2017

Looks great, thanks!

@feroldi feroldi deleted the patch-1 branch July 23, 2017 21:46
vitaut added a commit that referenced this pull request Jul 24, 2017
Suppress warning about missing noreturn attribute

Adding `[[noreturn]]` to `report_unknown_type` suppresses the Clang/GCC `-Wmissing-noreturn` warning:

Clang outputs:

    .../fmt/fmt/format.cc:294:74: warning:
          function 'report_unknown_type' could be declared with
          attribute 'noreturn' [-Wmissing-noreturn]
      ...code, const char *type) {
                                 ^

GCC outputs:

    .../fmt/fmt/format.cc:294:74: warning: function might be candidate for
        attribute 'noreturn' [-Wsuggest-attribute=noreturn]
      ...code, const char *type) {
                                 ^

Cherry-picked d16c4d.
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.

2 participants