From 610566823e46dbdf8ac272e89ce1dbef7a23c0f2 Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Tue, 30 Jul 2024 10:20:38 +0200 Subject: [PATCH] MT#60408 SdpMedia: initialize port and nports to 0 Explicitly set port and nports to 0 when initializing a brand new instance of SdpMedia. This resolves warnings: ../../core/AmSdp.h:168:8: warning: '*(__vector(2) unsigned int*)((char*)& + offsetof(SdpMedia, SdpMedia::port))' may be used uninitialized [-Wmaybe-uninitialized] 168 | struct SdpMedia | ^~~~~~~~ ../../core/AmSdp.h:168:8: warning: '.SdpMedia::nports' may be used uninitialized [-Wmaybe-uninitialized] 168 | struct SdpMedia Change-Id: Ifa2838ba0ef2f1a48b4fdc07b7bfaf8c5aefcfaa --- core/AmSdp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/AmSdp.h b/core/AmSdp.h index 4b82c373..df536efa 100644 --- a/core/AmSdp.h +++ b/core/AmSdp.h @@ -192,7 +192,7 @@ struct SdpMedia bool operator == (const SdpMedia& other) const; - SdpMedia() : conn(), dir(DirUndefined), type(MT_NONE), transport(TP_NONE), send(true), recv(true) {} + SdpMedia() : port(0), nports(0), conn(), dir(DirUndefined), type(MT_NONE), transport(TP_NONE), send(true), recv(true) {} /** pretty print */ string debugPrint() const;