I'm compiling some of Serenity's code with clang 11.1.0 and it reported some issues which may warrant fixing.
../.././AK/BitmapView.h:75:29: error: cast from 'const u8 *' (aka 'const unsigned char *') to 'const u32 *' (aka 'const unsigned int *') increases required alignment from 1 to 4 [-Werror,-Wcast-align]
ptr32 = (const u32*)last;
^~~~~~~~~~~~~~~~
../.././AK/BitmapView.h:214:25: error: cast from 'u8 *' (aka 'unsigned char *') to 'u32 *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Werror,-Wcast-align]
u32* bitmap32 = (u32*)m_data;
^~~~~~~~~~~~
../../Userland/Libraries/LibGfx/Path.cpp:21:23: error: implicit conversion increases floating-point precision: 'float' to 'double' [-Werror,-Wdouble-promotion]
double rx = radii.x();
~~ ~~~~~~^~~
../../Userland/Libraries/LibGfx/Path.cpp:22:23: error: implicit conversion increases floating-point precision: 'float' to 'double' [-Werror,-Wdouble-promotion]
double ry = radii.y();
~~ ~~~~~~^~~
../../Userland/Libraries/LibGfx/Path.cpp:91:47: error: implicit conversion increases floating-point precision: 'float' to 'double' [-Werror,-Wdouble-promotion]
x_avg = (last_point.x() + next_point.x()) / 2.0f;
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
../../Userland/Libraries/LibGfx/Path.cpp:92:47: error: implicit conversion increases floating-point precision: 'float' to 'double' [-Werror,-Wdouble-promotion]
y_avg = (last_point.y() + next_point.y()) / 2.0f;
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
../../Userland/Libraries/LibGfx/Rect.cpp:78:45: error: member reference base type 'Line' is not a structure or union
return Line { center(), other.center() }.length();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
../../Userland/Libraries/LibGfx/Rect.cpp:100:41: error: member reference base type 'Line' is not a structure or union
return Line { points[0], points[0] }.length();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
../../Userland/Libraries/LibGfx/Rect.cpp:169:54: error: member reference base type 'Line' is not a structure or union
auto distance = Line { point_on_line, point }.length();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too