CMake: Add back stricter warnings used in Serenity builds

These used to be enabled in `serenity_compile_options.cmake` for
Serenity builds and were removed in 9b05fb98. This is a slightly more
conservative subset of those, with ones that are enabled by default
omitted.

This should prevent our code quality regressing in the long run.
This commit is contained in:
Daniel Bertalan 2024-07-14 16:57:52 +02:00
parent 0961d68ebc
commit 7fe82a1cda
Notes: sideshowbarker 2024-07-18 08:27:17 +09:00
2 changed files with 6 additions and 2 deletions

View file

@ -19,8 +19,12 @@ else()
add_compile_options(-ffp-contract=off)
endif()
add_compile_options(-Wno-invalid-offsetof)
add_compile_options(-Wcast-qual)
add_compile_options(-Wformat=2)
add_compile_options(-Wimplicit-fallthrough)
add_compile_options(-Wsuggest-override)
add_compile_options(-Wno-invalid-offsetof)
add_compile_options(-Wno-unknown-warning-option)
add_compile_options(-Wno-unused-command-line-argument)

View file

@ -89,7 +89,7 @@ ErrorOr<void> JPEGWriter::encode_impl(Stream& stream, auto const& bitmap, Option
while (cinfo.next_scanline < cinfo.image_height) {
auto const* row_ptr = reinterpret_cast<u8 const*>(bitmap.scanline(cinfo.next_scanline));
JSAMPROW row_pointer = (JSAMPROW)row_ptr;
JSAMPROW row_pointer = const_cast<JSAMPROW>(row_ptr);
jpeg_write_scanlines(&cinfo, &row_pointer, 1);
}