{"id":2224744,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2224744/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260418063213.110024-1-heinrich.schuchardt@canonical.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.1/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260418063213.110024-1-heinrich.schuchardt@canonical.com>","date":"2026-04-18T06:32:13","name":"[1/1] tools/asn1_compiler: avoid -Wdiscarded-qualifiers","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"30eebfeb28d97d4571b2c2c668d18def5e4423fd","submitter":{"id":82181,"url":"http://patchwork.ozlabs.org/api/1.1/people/82181/?format=json","name":"Heinrich Schuchardt","email":"heinrich.schuchardt@canonical.com"},"delegate":{"id":3651,"url":"http://patchwork.ozlabs.org/api/1.1/users/3651/?format=json","username":"trini","first_name":"Tom","last_name":"Rini","email":"trini@ti.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260418063213.110024-1-heinrich.schuchardt@canonical.com/mbox/","series":[{"id":500420,"url":"http://patchwork.ozlabs.org/api/1.1/series/500420/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=500420","date":"2026-04-18T06:32:13","name":"[1/1] tools/asn1_compiler: avoid -Wdiscarded-qualifiers","version":1,"mbox":"http://patchwork.ozlabs.org/series/500420/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2224744/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2224744/checks/","tags":{},"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (4096-bit key;\n unprotected) header.d=canonical.com header.i=@canonical.com\n header.a=rsa-sha256 header.s=20251003 header.b=F/fpyKyX;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=pass (p=reject dis=none) header.from=canonical.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=pass (4096-bit key;\n unprotected) header.d=canonical.com header.i=@canonical.com\n header.b=\"F/fpyKyX\";\n\tdkim-atps=neutral","phobos.denx.de; dmarc=pass (p=reject dis=none)\n header.from=canonical.com","phobos.denx.de; spf=pass\n smtp.mailfrom=heinrich.schuchardt@canonical.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fyMP942Wqz1yGt\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 18 Apr 2026 16:32:29 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 7783F83BC8;\n\tSat, 18 Apr 2026 08:32:21 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 8A7A083FF5; Sat, 18 Apr 2026 08:32:20 +0200 (CEST)","from smtp-relay-canonical-0.canonical.com\n (smtp-relay-canonical-0.canonical.com [185.125.188.120])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 8A9EF83B99\n for <u-boot@lists.denx.de>; Sat, 18 Apr 2026 08:32:18 +0200 (CEST)","from LT03.fritz.box (ip-176-199-115-125.um44.pools.vodafone-ip.de\n [176.199.115.125])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPSA id 017BF3F0C6;\n Sat, 18 Apr 2026 06:32:17 +0000 (UTC)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,\n RCVD_IN_VALIDITY_RPBL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com;\n s=20251003; t=1776493938;\n bh=D1d/7WUqxje3mhUrIZnjGwIC1g2onBLL21mnb6Tm+vA=;\n h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type;\n b=F/fpyKyXwp2b1ciIzsA65h4yfDVXIW//apoF6xtr9XWT5JXWhTUgAfj1ianlDIbJM\n PUCXISkXGNiqz0t4TTRSbrOW14Qf0+Dq4RuwFOGsF3l5zo0KJ8iE+NvaDh1dGRFOSm\n PYiqU02tkbCJuNxBswyY3AljfGPKe9rih5enT+HOGHKX27oMhahnopAv1CWARBZn3M\n ujDKpPohRZnBGCYYpxda+NcdCMoq3ep5SDbvR510z52nqaQ6pZSw7j75vl6d9sJRPf\n WxKMvmIZCV1K39RpOVa7Y633W3nLXcf0mYkG5H67vSAXv+sqylfa0XMh4EelE+IM52\n vJ+1IGSQHJjMGLTE11I1mJm1YhGSgoFMj8k+VOXGN1qLCvwEf6znkYBnYo0UjC6FHw\n 9jr+yE1rAJYEhS0B7vs0IVU/rddFBNDbpj+8dmmndrusQyP2Rur8R4M4IMMXolTMxa\n G7n8sxHZk33Dk48H+opnvOZoruILJIbbSsZEBE7siNc79zm8nMC35wqUU4teGYxC6f\n JHxioiDnsOts1GnskBdZ4mUTyq/W0vzcEknj5EnnjPXm6/oX9IAoF6UaQan2uWna7L\n J/ZTYQhNWKroX3cI2rF8ldqvfvW9IgbQYP1IG5rBsGzdcU2/5MnMmxKO0Oc73nhloV\n YZlpvV22fmzAorzUrCVPIVFY=","From":"Heinrich Schuchardt <heinrich.schuchardt@canonical.com>","To":"Tom Rini <trini@konsulko.com>","Cc":"u-boot@lists.denx.de,\n Heinrich Schuchardt <heinrich.schuchardt@canonical.com>","Subject":"[PATCH 1/1] tools/asn1_compiler: avoid -Wdiscarded-qualifiers","Date":"Sat, 18 Apr 2026 08:32:13 +0200","Message-ID":"<20260418063213.110024-1-heinrich.schuchardt@canonical.com>","X-Mailer":"git-send-email 2.53.0","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"Building with GCC 15.2 results in warnings:\n\n    tools/asn1_compiler.c: In function ‘tokenise’:\n    tools/asn1_compiler.c:442:37: warning:\n    assignment discards ‘const’ qualifier from pointer target type\n    [-Wdiscarded-qualifiers]\n      442 |             dir = bsearch(&tokens[tix], directives,\n          |                 ^\n\n    tools/asn1_compiler.c: In function ‘main’:\n    tools/asn1_compiler.c:632:11: warning:\n    assignment discards ‘const’ qualifier from pointer target type\n    [-Wdiscarded-qualifiers]\n      632 |         p = strchr(grammar_name, '.');\n          |           ^\n\nbsearch() is defined as\n\n       void *bsearch(size_t n, size_t size;\n                     const void key[size], const void base[size * n],\n                     size_t n, size_t size,\n                     typeof(int (const void [size], const void [size]))\n                         *compar);\n\n* Use the correct type for dir.\n\nstrchr() is defined as\n\n        char *strchr(const char *s, int c).\n\n* Use a conversion for the assignment to p.\n\nSigned-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>\n---\n tools/asn1_compiler.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)","diff":"diff --git a/tools/asn1_compiler.c b/tools/asn1_compiler.c\nindex 03fb7e03758..c2ca467e18f 100644\n--- a/tools/asn1_compiler.c\n+++ b/tools/asn1_compiler.c\n@@ -409,7 +409,7 @@ static void tokenise(char *buffer, char *end)\n \n \t\t\t/* Handle string tokens */\n \t\t\tif (isalpha(*p)) {\n-\t\t\t\tconst char **dir;\n+\t\t\t\tconst char * const *dir;\n \n \t\t\t\t/* Can be a directive, type name or element\n \t\t\t\t * name.  Find the end of the name.\n@@ -629,7 +629,7 @@ int main(int argc, char **argv)\n \t\tperror(NULL);\n \t\texit(1);\n \t}\n-\tp = strchr(grammar_name, '.');\n+\tp = (char *)strchr(grammar_name, '.');\n \tif (p)\n \t\t*p = '\\0';\n \n","prefixes":["1/1"]}