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

Fix missing return statements that are seen with -Werror=return-type. #5654

Merged
merged 1 commit into from
Jul 16, 2019

Conversation

marxin
Copy link
Contributor

@marxin marxin commented Jul 15, 2019

Error example:

Code:

        #include <locale.h>
        int main () {
            /* If it's not defined as a macro, try to use as a symbol */
            #ifndef LC_MESSAGES
                LC_MESSAGES;
            #endif
        }
Compiler stdout:

Compiler stderr:
 In file included from /usr/include/locale.h:25,
                 from /tmp/tmpep_i4iwg/testfile.c:2:
/usr/include/features.h:382:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  382 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
/tmp/tmpep_i4iwg/testfile.c: In function 'main':
/tmp/tmpep_i4iwg/testfile.c:8:9: error: control reaches end of non-void function [-Werror=return-type]
    8 |         }
      |         ^
cc1: some warnings being treated as errors

@marxin marxin force-pushed the fix-return-type-warnings branch 2 times, most recently from 4d87b40 to d331e6b Compare July 15, 2019 08:49
@marxin
Copy link
Contributor Author

marxin commented Jul 15, 2019

It's problematic with older C standards.

@scivision
Copy link
Member

I generally think this is a good idea. I try to fix these when I see them.

@dcbaker
Copy link
Member

dcbaker commented Jul 15, 2019

Can you rebase this, and then we'll merge it?

@nirbheek nirbheek added this to the 0.51.2 milestone Jul 15, 2019
Error example:

Code:

        #include <locale.h>
        int main () {
            /* If it's not defined as a macro, try to use as a symbol */
            #ifndef LC_MESSAGES
                LC_MESSAGES;
            #endif
        }
Compiler stdout:

Compiler stderr:
 In file included from /usr/include/locale.h:25,
                 from /tmp/tmpep_i4iwg/testfile.c:2:
/usr/include/features.h:382:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
  382 | #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
      |    ^~~~~~~
/tmp/tmpep_i4iwg/testfile.c: In function 'main':
/tmp/tmpep_i4iwg/testfile.c:8:9: error: control reaches end of non-void function [-Werror=return-type]
    8 |         }
      |         ^
cc1: some warnings being treated as errors
@marxin
Copy link
Contributor Author

marxin commented Jul 16, 2019

Can you rebase this, and then we'll merge it?

Yep, I've just done that.

@scivision
Copy link
Member

thanks!

@scivision scivision merged commit 1b2d54a into mesonbuild:master Jul 16, 2019
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.

4 participants