mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 12:34:55 +00:00
libnm: avoid "-Walloc-size" warning in nm_team_link_watcher_new_ethtool()
gcc-14.0.1-0.2.fc40 warns:
CC src/libnm-core-impl/libnm_core_impl_la-nm-setting-team.lo
../src/libnm-core-impl/nm-setting-team.c: In function nm_team_link_watcher_new_ethtool:
../src/libnm-core-impl/nm-setting-team.c:127:13: error: allocation of insufficient size 16 for type NMTeamLinkWatcher with size 48 [-Werror=alloc-size]
127 | watcher = g_malloc(nm_offsetofend(NMTeamLinkWatcher, ethtool));
| ^
(cherry picked from commit 5715feebe7
)
This commit is contained in:
parent
b7fa330ac5
commit
eaa3a4e396
|
@ -123,6 +123,7 @@ nm_team_link_watcher_new_ethtool(int delay_up, int delay_down, GError **error)
|
|||
}
|
||||
|
||||
NM_PRAGMA_WARNING_DISABLE("-Warray-bounds")
|
||||
NM_PRAGMA_WARNING_DISABLE("-Walloc-size")
|
||||
|
||||
watcher = g_malloc(nm_offsetofend(NMTeamLinkWatcher, ethtool));
|
||||
|
||||
|
@ -131,6 +132,7 @@ nm_team_link_watcher_new_ethtool(int delay_up, int delay_down, GError **error)
|
|||
watcher->ethtool.delay_up = delay_up;
|
||||
watcher->ethtool.delay_down = delay_down;
|
||||
|
||||
NM_PRAGMA_WARNING_REENABLE
|
||||
NM_PRAGMA_WARNING_REENABLE
|
||||
|
||||
return watcher;
|
||||
|
|
Loading…
Reference in a new issue