mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Userland: Fix new GCC warnings
This commit is contained in:
parent
8cd62b5780
commit
c861195557
Notes:
sideshowbarker
2024-07-18 18:56:35 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/c8611955571 Pull-request: https://github.com/SerenityOS/serenity/pull/6552
5 changed files with 12 additions and 3 deletions
|
@ -142,7 +142,10 @@ void Label::wrap_text()
|
|||
case '\t':
|
||||
case ' ': {
|
||||
if (start.has_value())
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
words.append(m_text.substring(start.value(), i - start.value()));
|
||||
#pragma GCC diagnostic pop
|
||||
start.clear();
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -176,7 +176,10 @@ int main(int argc, char** argv)
|
|||
if (!uninitialized_memory)
|
||||
return Crash::Failure::UnexpectedError;
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
[[maybe_unused]] volatile auto x = uninitialized_memory[0][0];
|
||||
#pragma GCC diagnostic pop
|
||||
return Crash::Failure::DidNotCrash;
|
||||
}).run(run_type);
|
||||
}
|
||||
|
@ -199,7 +202,10 @@ int main(int argc, char** argv)
|
|||
if (!uninitialized_memory)
|
||||
return Crash::Failure::UnexpectedError;
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
uninitialized_memory[4][0] = 1;
|
||||
#pragma GCC diagnostic pop
|
||||
return Crash::Failure::DidNotCrash;
|
||||
}).run(run_type);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ int main(int argc, char** argv)
|
|||
if (write_to_stdout)
|
||||
keep_input_files = true;
|
||||
|
||||
for (const String& input_filename : filenames) {
|
||||
for (const String input_filename : filenames) {
|
||||
auto output_filename = String::formatted("{}.gz", input_filename);
|
||||
|
||||
// We map the whole file instead of streaming to reduce size overhead (gzip header) and increase the deflate block size (better compression)
|
||||
|
|
|
@ -175,7 +175,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
};
|
||||
|
||||
for (const String& path : paths) {
|
||||
for (const String path : paths) {
|
||||
if (Core::File::is_directory(path)) {
|
||||
add_directory(path, add_directory);
|
||||
} else {
|
||||
|
|
|
@ -104,7 +104,7 @@ int main(int argc, char** argv)
|
|||
}
|
||||
};
|
||||
|
||||
for (const String& source_path : source_paths) {
|
||||
for (const String source_path : source_paths) {
|
||||
if (Core::File::is_directory(source_path)) {
|
||||
add_directory(source_path, add_directory);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue