NetBSD Problem Report #60945

From www@netbsd.org  Fri Oct 30 22:58:41 2026
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(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
	 client-signature RSA-PSS (2048 bits) client-digest SHA256)
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id ED4EB1A923B
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 30 Oct 2026 22:58:40 +0000 (UTC)
Message-Id: <20261030225839.A908B1A923C@mollari.NetBSD.org>
Date: Fri, 30 Oct 2026 22:58:39 +0000 (UTC)
From: nia@pkgsrc.org
Reply-To: nia@pkgsrc.org
To: gnats-bugs@NetBSD.org
Subject: libmenu (curses): arguments of new_item function should be constified
X-Send-Pr-Version: www-1.0
X-From4GNATS: "nia@pkgsrc.org via gnats" <gnats-admin@NetBSD.org>

>Number:         60945
>Category:       lib
>Synopsis:       libmenu (curses): arguments of new_item function should be constified
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 30 23:00:00 +0000 2026
>Last-Modified:  Sun Nov 01 03:15:01 +0000 2026
>Originator:     nia
>Release:        
>Organization:
The CursedBSD Foundation
>Environment:
NetBSD siphon 11.99.9 NetBSD 11.99.9 (SIPHON) #2: Sun Oct 11 21:09:47 CEST 2026  nia@siphon:/encrypt/obj/sys/arch/amd64/compile/SIPHON amd64
>Description:
new_item(3) has the following signature:

ITEM *new_item(char *, char *);

in ncurses it has the following signature:

extern MENU_EXPORT(ITEM *) new_item(const char *, const char *);

The lack of const causes problems because API users probably want to
pass string literals to this function. And then gcc complains that
the const is being discarded.

I don't see why it would need to modify the strings: "new_item()
allocates storage for a new item then copies in the item name
and description for the new item."

libmenu is not part of X/Open Curses, and there's no specification
to go on here. Looks like illumos (i.e. SVR4) libmenu has the same
signature as NetBSD:

extern ITEM *new_item(char *, char *);

Recent decisions made in this field would perhaps indicate we value
compatibility with ncurses over history here.
>How-To-Repeat:

>Fix:

>Audit-Trail:
From: Valery Ushakov <uwe@stderr.spb.ru>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: lib/60945: libmenu (curses): arguments of new_item function
 should be constified
Date: Sun, 1 Nov 2026 06:02:51 +0300

 On Fri, Oct 30, 2026 at 23:00:00 +0000, nia@pkgsrc.org via gnats wrote:

 > new_item(3) has the following signature:
 > 
 > ITEM *new_item(char *, char *);

 The 80's calling :)

 We should fix the constness and align with ncurses.

 -uwe

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.