From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] hash: fix possible uninitialized variable Date: Sat, 22 Dec 2018 23:43:50 -0800 Message-ID: <20181222234350.789e2a28@xeon-e3> References: <20181222121100.52827-1-haiyangtan@tencent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Cristian Dumitrescu , dev@dpdk.org To: Haiyang Tan Return-path: Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by dpdk.org (Postfix) with ESMTP id 6F5861B76F for ; Sun, 23 Dec 2018 08:43:58 +0100 (CET) Received: by mail-pg1-f169.google.com with SMTP id m1so4403601pgq.8 for ; Sat, 22 Dec 2018 23:43:58 -0800 (PST) In-Reply-To: <20181222121100.52827-1-haiyangtan@tencent.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Sat, 22 Dec 2018 04:10:59 -0800 Haiyang Tan wrote: > The uninitialized field 'extra_flag' of hash_cuckoo_params may enable > certain feature silently. Typically, if bit0 of 'extra_flag' set, the > hardware transactional memory support will be enabled unexpectedly. > > Signed-off-by: Haiyang Tan This is not necessary. Structure initializations will fill in the other elements with zero. https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Designated-Inits.html Omitted field members are implicitly initialized the same as objects that have static storage duration.