From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine 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=GzAgXz7x; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 6D6855A027C for ; Tue, 13 May 2025 11:41:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1747129269; 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=rVnb2z+5NfVrzhqNqpPqs2CQNuEJFfJfLw3emGnBaiU=; b=GzAgXz7xlbadnrBRiIyPYCLgz20zjy+HIupwlNy6TO+qnpUFqFUdNJ3F7M4pMffkPnKaqr jYPZzJPygThnLhrXPa0qGr0BsArCaESnhBFVi0aoItNsFsHjdYLeMzEohFA7EEE3b0Rm3g IEam6/8Y3SBY7anIMNFLdtTrZMtRrkk= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-687-XDCtl0VtPreD2bLAtwW5ng-1; Tue, 13 May 2025 05:41:08 -0400 X-MC-Unique: XDCtl0VtPreD2bLAtwW5ng-1 X-Mimecast-MFC-AGG-ID: XDCtl0VtPreD2bLAtwW5ng_1747129267 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7372F1955D85 for ; Tue, 13 May 2025 09:41:07 +0000 (UTC) Received: from lenovo-t14s.redhat.com (unknown [10.44.33.64]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 4B450195396E; Tue, 13 May 2025 09:41:06 +0000 (UTC) From: Laurent Vivier To: passt-dev@passt.top Subject: [PATCH 1/4] dhcpv6: fix GCC error (unterminated-string-initialization) Date: Tue, 13 May 2025 11:40:59 +0200 Message-ID: <20250513094102.1372330-2-lvivier@redhat.com> In-Reply-To: <20250513094102.1372330-1-lvivier@redhat.com> References: <20250513094102.1372330-1-lvivier@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 3JGLtW94WIY1AHsPL6pzMehzaRzsnOI4Oll5rl3qsHc_1747129267 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: YFAONEHCP5T2MJ3O2QIMEUYQZG2OM43Y X-Message-ID-Hash: YFAONEHCP5T2MJ3O2QIMEUYQZG2OM43Y X-MailFrom: lvivier@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: Laurent Vivier 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: The string STR_NOTONLINK is intentionally not NUL-terminated. Ignore the GCC error using __attribute__((nonstring)). This error is reported by GCC 15.1.1 on Fedora 42. However, Clang 20.1.3 does not support __attribute__((nonstring)). Therefore, NOLINTNEXTLINE(clang-diagnostic-unknown-attributes) is also added to suppress Clang's unknown attribute warning. Signed-off-by: Laurent Vivier --- dhcpv6.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dhcpv6.c b/dhcpv6.c index 373a98869f9b..ba16c664ee24 100644 --- a/dhcpv6.c +++ b/dhcpv6.c @@ -144,7 +144,9 @@ struct opt_ia_addr { struct opt_status_code { struct opt_hdr hdr; uint16_t code; - char status_msg[sizeof(STR_NOTONLINK) - 1]; + /* "nonstring" is only supported since clang 23 */ + /* NOLINTNEXTLINE(clang-diagnostic-unknown-attributes) */ + __attribute__((nonstring)) char status_msg[sizeof(STR_NOTONLINK) - 1]; } __attribute__((packed)); /** -- 2.49.0