Avoid -Wmissing-field-initializers for Dl_info struct
Rely on the default initialization, this is arguably slightly less clear, but allows to avoid the warning (which is disabled by default, but still). Closes #17997.
This commit is contained in:
@@ -285,7 +285,7 @@ wxDynamicLibraryDetailsArray wxDynamicLibrary::ListLoaded()
|
|||||||
void* wxDynamicLibrary::GetModuleFromAddress(const void* addr, wxString* path)
|
void* wxDynamicLibrary::GetModuleFromAddress(const void* addr, wxString* path)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_DLADDR
|
#ifdef HAVE_DLADDR
|
||||||
Dl_info di = { 0 };
|
Dl_info di = { }; // 0 initialize whatever fields the struct has
|
||||||
|
|
||||||
// At least under Solaris dladdr() takes non-const void*.
|
// At least under Solaris dladdr() takes non-const void*.
|
||||||
if ( dladdr(const_cast<void*>(addr), &di) == 0 )
|
if ( dladdr(const_cast<void*>(addr), &di) == 0 )
|
||||||
|
Reference in New Issue
Block a user