summaryrefslogtreecommitdiff
path: root/Meta/screenshot-000ccc0.png
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2021-08-11 10:36:08 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-12 21:10:44 +0200
commitf95a11a7daa7c29aa0a019b9c965bfdd6f3cb69a (patch)
treebc50d9cb4f1a51e4bbddb6e18220101854774d4a /Meta/screenshot-000ccc0.png
parent8b6397446e9b63c34c4275700050d35caf407e58 (diff)
downloadserenity-f95a11a7daa7c29aa0a019b9c965bfdd6f3cb69a.zip
LibC: Don't delete null check in `gettimeofday`
The `nonnull` attribute may delete null checks in the generated code, as per the [GCC documentation]: > The compiler may also perform optimizations based on the knowledge > that nonnul parameters cannot be null. This can currently not be > disabled other than by removing the nonnull attribute. Disassembling the function as compiled by GCC, we can see that there is no branch based on if `tv` is null. This means that `gettimeofday` would produce UB if passed a null parameter, even if we wanted to predictably return an error. Clang refuses to compile this due to a `pointer-bool-conversion` warning. In this commit, `settimeofday` is changed as well to match `gettimeofday`'s null argument handling. [GCC documentation]: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-nonnull-function-attribute
Diffstat (limited to 'Meta/screenshot-000ccc0.png')
0 files changed, 0 insertions, 0 deletions