From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=IGoa7hJ3; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 89B555A004C for ; Fri, 25 Oct 2024 09:53:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729842836; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HEqX0jTjFTl/4ZDRmcAmZTnsbaTN37lRvwy4OddxNGY=; b=IGoa7hJ3MaCv+NofAQLjq1NAeGc0Jk3D6McTzcQzV4H8Rpgdx/9nYx6SqtE3inGz6r9pMw /uaPJH2enUXOk07o67zeFQyrC8F9UpAChIXcHeOYXKZdfBOls4BmIgjricOQZVLN0gz+U9 xkzDy6u6NA93bibqI32lU5Vq3JG0b78= Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-84--JKfEn11M0OqOjmaq6TM7g-1; Fri, 25 Oct 2024 03:53:21 -0400 X-MC-Unique: -JKfEn11M0OqOjmaq6TM7g-1 Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-7ea69eeb659so1534662a12.0 for ; Fri, 25 Oct 2024 00:53:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729842800; x=1730447600; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=HEqX0jTjFTl/4ZDRmcAmZTnsbaTN37lRvwy4OddxNGY=; b=oMm9i88zGbYELXCfSJkxwgy2RMyvO+KRNX1VOW7WTfJFmSwe+9HG843itiOaTkdmHF s1pM0+82807VcGUbAP2g3SJ/iira0EJe+tFlGt1w2ghudiVbSFR6lH83Re6EXJqCTSmn 6nVnVjATcHe/ob+Lim4b3f2cmp29GgdaHAAyOtcT/jmGiGw4Lv1dgVVM9xeqz2nDZwES tgBDeDMyqcExO3ElVT5VM3iP6gdtif7raDFTnL9aCZgb+MqQQmTvpAEIT8mxSNgY2bl/ L3E3DeJAFWQapyifnxPPIvAxGQyDD58DSC6erm7adyfelutlq8X4+jukEz/udHe3WNuE c9NA== X-Gm-Message-State: AOJu0Yw760FWygJmDc+iNXVkQl3xajJ/tN6CnXED/veUykErjt88o90/ e4Vw2lIjaAfGC62UyzMBJ3WTt/Olr5E41ExMv+G8syPFZsnuyI/Cg+WMF0l9whliqgccU8pF6g1 Nrzt7tPaRgMWhMiiLyLAU1Sc1jI0NwUuIRWqSX8+K9WUwK+JQlg== X-Received: by 2002:a17:903:1ce:b0:20c:b876:b4eb with SMTP id d9443c01a7336-20fab2fe2b5mr131568585ad.59.1729842800059; Fri, 25 Oct 2024 00:53:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFIkJZf2Jvx21kSpySLkSGf/K9BL6/r56jQbxyxfniNXozkVmrGLb161uEpoVrQMfLZieoI4Q== X-Received: by 2002:a17:903:1ce:b0:20c:b876:b4eb with SMTP id d9443c01a7336-20fab2fe2b5mr131568455ad.59.1729842799701; Fri, 25 Oct 2024 00:53:19 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-210bbf43308sm4928055ad.43.2024.10.25.00.53.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2024 00:53:17 -0700 (PDT) Date: Fri, 25 Oct 2024 09:53:13 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 7/8] udp: Take care of cert-int09-c clang-tidy warning for enum udp_iov_idx Message-ID: <20241025095313.32fd9ff3@elisabeth> In-Reply-To: References: <20241024230438.3192725-1-sbrivio@redhat.com> <20241024230438.3192725-8-sbrivio@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 3AAH77DE7AJEK2KD77SYYVJWGIJ3TVGL X-Message-ID-Hash: 3AAH77DE7AJEK2KD77SYYVJWGIJ3TVGL X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri, 25 Oct 2024 12:02:17 +1100 David Gibson wrote: > On Fri, Oct 25, 2024 at 01:04:37AM +0200, Stefano Brivio wrote: > > /home/sbrivio/passt/udp.c:171:1: error: inital values in enum 'udp_iov_idx' are not consistent, consider explicit initialization of all, none or only the first enumerator [cert-int09-c,readability-enum-initial-value,-warnings-as-errors] > > 171 | enum udp_iov_idx { > > | ^ > > 172 | UDP_IOV_TAP = 0, > > 173 | UDP_IOV_ETH = 1, > > 174 | UDP_IOV_IP = 2, > > 175 | UDP_IOV_PAYLOAD = 3, > > 176 | UDP_NUM_IOVS > > | > > | = 4 > > > > Make sure we initialise all the values, in this case. > > Oof. Although it's a bit weird, I quite like the existing style, > because it gives the correct value for NUM_WHATEVER without requiring > editing if a new explicit value is inserted above it. > > I'd be inclined to use a suppression rather than changing the code. I see your point, but still it would be practical to just comply with INT09-C: https://wiki.sei.cmu.edu/confluence/display/c/INT09-C.+Ensure+enumeration+constants+map+to+unique+values ...avoiding integer assignments altogether would do the trick as well. Perhaps I should go with that instead. -- Stefano