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

Remove global -Wno-return-type from CMakeLists.txt #9387

Closed

Conversation

acvictor
Copy link
Contributor

@acvictor acvictor commented Apr 5, 2024

This PR makes a change to remove the globally applied -Wno-return-type and fixes some violations. PR #4618 originally disabled it. In the case of a code bug, it may become difficult to diagnose the actual cause. An example of this is

#include <stdio.h>
 
bool test1()
{
    printf("Called inner\n");
}
void test()
{
    test1();
} 
 
int main(int argc, char* argv[])
{
    printf("Called test\n");
    test();
    printf("Finished test\n");
    return 0;
}

which crashes when compiled with -O2 due to bad codegen.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 5, 2024
Copy link

netlify bot commented Apr 5, 2024

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 144e55d
🔍 Latest deploy log https://app.netlify.com/sites/meta-velox/deploys/66160b8b369f3900083c7c5e

@acvictor acvictor changed the title Remove -Wno-return-type Remove global -Wno-return-type from CMakeLists.txt Apr 5, 2024
@acvictor acvictor marked this pull request as ready for review April 6, 2024 11:21
@acvictor acvictor changed the title Remove global -Wno-return-type from CMakeLists.txt Remove global -Wno-return-type from CMakeLists.txt for GCC < 12.2 Apr 6, 2024
@acvictor acvictor changed the title Remove global -Wno-return-type from CMakeLists.txt for GCC < 12.2 Remove global -Wno-return-type from CMakeLists.txt for gcc < 12.2 Apr 6, 2024
@acvictor
Copy link
Contributor Author

acvictor commented Apr 6, 2024

@pedroerp @mbasmanova can you please review this change?

velox/exec/tests/TableWriteTest.cpp Outdated Show resolved Hide resolved
velox/functions/prestosql/types/JsonType.cpp Show resolved Hide resolved
velox/functions/remote/if/GetSerde.cpp Outdated Show resolved Hide resolved
velox/connectors/hive/HivePartitionFunction.cpp Outdated Show resolved Hide resolved
@assignUser
Copy link
Collaborator

I am absolutely for the removal of global warning suppression, it seems pragmas are the way to go here as adding the warning to the target would also potentially shadow actual issues... in that regard it would also be nice to not disable the warning globally for >12.2 (though just using clang in at least one ci job would also be a workaround...)

CMakeLists.txt Outdated Show resolved Hide resolved
velox/exec/tests/TableWriteTest.cpp Outdated Show resolved Hide resolved
@acvictor acvictor changed the title Remove global -Wno-return-type from CMakeLists.txt for gcc < 12.2 Remove global -Wno-return-type from CMakeLists.txt Apr 9, 2024
@acvictor
Copy link
Contributor Author

acvictor commented Apr 9, 2024

@mbasmanova @pedroerp can you please give this another review?

Copy link
Contributor

@pedroerp pedroerp left a comment

Choose a reason for hiding this comment

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

One last small comment, but overall looks good to me.

velox/functions/remote/if/GetSerde.cpp Outdated Show resolved Hide resolved
@acvictor
Copy link
Contributor Author

acvictor commented Apr 9, 2024

One last small comment, but overall looks good to me.

Thank you for the review!

Copy link
Contributor

@pedroerp pedroerp 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 @acvictor

@pedroerp pedroerp added the ready-to-merge PR that have been reviewed and are ready for merging. PRs with this tag notify the Velox Meta oncall label Apr 9, 2024
@facebook-github-bot
Copy link
Contributor

@mbasmanova has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@mbasmanova
Copy link
Contributor

@acvictor Would you rebase?

@acvictor
Copy link
Contributor Author

@acvictor Would you rebase?

Done, thanks!

@facebook-github-bot
Copy link
Contributor

@mbasmanova has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@mbasmanova merged this pull request in 22279f9.

Copy link

Conbench analyzed the 1 benchmark run on commit 22279f99.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

yanngyoung pushed a commit to yanngyoung/velox that referenced this pull request Apr 12, 2024
…#9387)

Summary:
This PR makes a change to remove the globally applied `-Wno-return-type`, fixes some violations. This PR originally facebookincubator#4618 disabled it. In the case of a code bug, it may become difficult to diagnose the actual cause. An example of this is

```
#include <stdio.h>

bool test1()
{
    printf("Called inner\n");
}
void test()
{
    test1();
}

int main(int argc, char* argv[])
{
    printf("Called test\n");
    test();
    printf("Finished test\n");
    return 0;
}
```
which crashes when compiled with -O2 due to bad codegen.

Pull Request resolved: facebookincubator#9387

Reviewed By: pedroerp

Differential Revision: D55933467

Pulled By: mbasmanova

fbshipit-source-id: da748fc5df19adb3d6e295973cc12e75ac43f2c1
Joe-Abraham pushed a commit to Joe-Abraham/velox that referenced this pull request Jun 7, 2024
…#9387)

Summary:
This PR makes a change to remove the globally applied `-Wno-return-type`, fixes some violations. This PR originally facebookincubator#4618 disabled it. In the case of a code bug, it may become difficult to diagnose the actual cause. An example of this is

```
#include <stdio.h>

bool test1()
{
    printf("Called inner\n");
}
void test()
{
    test1();
}

int main(int argc, char* argv[])
{
    printf("Called test\n");
    test();
    printf("Finished test\n");
    return 0;
}
```
which crashes when compiled with -O2 due to bad codegen.

Pull Request resolved: facebookincubator#9387

Reviewed By: pedroerp

Differential Revision: D55933467

Pulled By: mbasmanova

fbshipit-source-id: da748fc5df19adb3d6e295973cc12e75ac43f2c1
@acvictor acvictor deleted the acvictor/removeNoRetrun branch June 12, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged ready-to-merge PR that have been reviewed and are ready for merging. PRs with this tag notify the Velox Meta oncall
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants