The `-Wstringop-overread` fix feels a bit questionable (so I'll add Eric as a reviewer to clarify the MSC structs details)
-- v4: winedump: Initialize size variable in dump_dir_exceptions(). winedump: Use offsetof() for string position calculations.
From: Eric Pouech epouech@codeweavers.com
This fixes -Wstringop-overread warnings with GCC 14. --- tools/winedump/msc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/winedump/msc.c b/tools/winedump/msc.c index cb5fbb0b9ad..8cf698fa88a 100644 --- a/tools/winedump/msc.c +++ b/tools/winedump/msc.c @@ -527,7 +527,7 @@ static void do_field(const unsigned char* start, const unsigned char* end)
case LF_ENUMERATE_V3: leaf_len = full_numeric_leaf(&full_value, &fieldtype->enumerate_v3.value); - cstr = (const char*)&fieldtype->enumerate_v3.value + leaf_len; + cstr = (const char*)fieldtype + offsetof(union codeview_fieldtype, enumerate_v3.value) + leaf_len; printf("\t\tEnumerate V3: '%s' value:%s\n", cstr, full_value_string(&full_value)); ptr += 2 + 2 + leaf_len + strlen(cstr) + 1; @@ -553,7 +553,7 @@ static void do_field(const unsigned char* start, const unsigned char* end)
case LF_MEMBER_V3: leaf_len = numeric_leaf(&value, &fieldtype->member_v3.offset); - cstr = (const char*)&fieldtype->member_v3.offset + leaf_len; + cstr = (const char*)fieldtype + offsetof(union codeview_fieldtype, member_v3.offset) + leaf_len; printf("\t\tMember V3: '%s' type:%x attr:%s @%d\n", cstr, fieldtype->member_v3.type, get_attr(fieldtype->member_v3.attribute), value); @@ -894,7 +894,7 @@ static void codeview_dump_one_type(unsigned curr_type, const union codeview_type case LF_STRUCTURE_V3: case LF_CLASS_V3: leaf_len = numeric_leaf(&value, &type->struct_v3.structlen); - str = (const char*)&type->struct_v3.structlen + leaf_len; + str = (const char*)type + offsetof(union codeview_type, struct_v3.structlen) + leaf_len; printf("\t%x => %s V3 '%s' elts:%u property:%s\n" " fieldlist-type:%x derived-type:%x vshape:%x size:%u\n", curr_type, type->generic.id == LF_CLASS_V3 ? "Class" : "Struct", @@ -923,7 +923,7 @@ static void codeview_dump_one_type(unsigned curr_type, const union codeview_type
case LF_UNION_V3: leaf_len = numeric_leaf(&value, &type->union_v3.un_len); - str = (const char*)&type->union_v3.un_len + leaf_len; + str = (const char*)type + offsetof(union codeview_type, union_v3.un_len) + leaf_len; printf("\t%x => Union V3 '%s' count:%u property:%s fieldlist-type:%x size:%u\n", curr_type, str, type->union_v3.count, get_property(type->union_v3.property),
From: Aida Jonikienė aidas957@gmail.com
This fixes a -Wmaybe-uninitialized warning in GCC 14. --- tools/winedump/pe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/winedump/pe.c b/tools/winedump/pe.c index 22260e5249b..08859d0e9d4 100644 --- a/tools/winedump/pe.c +++ b/tools/winedump/pe.c @@ -1713,7 +1713,7 @@ static void dump_arm64_unwind_info( const struct runtime_function_arm64 *func ) static void dump_dir_exceptions(void) { static const void *arm64_funcs; - unsigned int i, size; + unsigned int i, size = 0; const void *funcs; const IMAGE_FILE_HEADER *file_header = &PE_nt_headers->FileHeader; const IMAGE_ARM64EC_METADATA *metadata;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=145688
Your paranoid android.
=== debian11b (64 bit WoW report) ===
Report validation errors: shell32:shelllink crashed (c0000005)
Wine-9.10 (no staging, etc) with the latest version of this MR and -Werror built fine on Fedora 40 x86_64 with GCC 14.1.1. Full build log here: https://download.copr.fedorainfracloud.org/results/patrickl/wine/fedora-40-x... Thanks for the fixes @DodoGTA
This merge request was closed by Aida Jonikienė.
This has been superseeded by !6064 and !6066