1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:08:13 +00:00
serenity/Userland
Daniel Bertalan f95a11a7da 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
2021-08-12 21:10:44 +02:00
..
Applets Everywhere: Replace Model::update() with Model::invalidate() 2021-08-06 19:14:31 +02:00
Applications 3DFileViewer: Allow zooming via mouse wheel 2021-08-12 20:57:19 +02:00
Demos Mandelbrot: Only recalculate missing areas after panning 2021-08-10 09:48:12 +02:00
DevTools Revert "HackStudio: Remove noop code when opening the project" 2021-08-12 20:56:54 +02:00
DynamicLoader DynamicLoader: Make sure we don't link against libgcc_s 2021-08-08 16:41:51 +02:00
Games Solitaire: Don't allow the player to draw cards while mouse is down 2021-08-07 16:59:46 +02:00
Libraries LibC: Don't delete null check in gettimeofday 2021-08-12 21:10:44 +02:00
Services Userland: Fix PATH environment variable ordering 2021-08-12 18:56:30 +02:00
Shell Userland: Fix PATH environment variable ordering 2021-08-12 18:56:30 +02:00
Utilities Kernel+LibC: Use 64 bit values for ino_t 2021-08-12 20:57:32 +02:00
CMakeLists.txt Tests: Establish root Tests directory, move Userland/Tests there 2021-05-06 17:54:28 +02:00