NetBSD Problem Report #60921

From www@netbsd.org  Sat Oct 24 16:17:23 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)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C7FCC1A923C
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 24 Oct 2026 16:17:22 +0000 (UTC)
Message-Id: <20261024161721.F118E1A923D@mollari.NetBSD.org>
Date: Sat, 24 Oct 2026 16:17:21 +0000 (UTC)
From: phil@hagelb.org
Reply-To: phil@hagelb.org
To: gnats-bugs@NetBSD.org
Subject: m4 --undefine argument does not undefine
X-Send-Pr-Version: www-1.0
X-From4GNATS: "phil@hagelb.org via gnats" <gnats-admin@NetBSD.org>

>Number:         60921
>Category:       bin
>Synopsis:       m4 --undefine argument does not undefine
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 24 16:20:00 +0000 2026
>Originator:     Phil Hagelberg
>Release:        11.0
>Organization:
>Environment:
NetBSD coronacht 11.0 NetBSD 11.0 (GENERIC) #0: Thu Jul 30 15:23:12 UTC 2026  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
According to the man page, m4 accepts a -U or --undefine argument which will take whatever symbol it's given and remove whatever definition is attached to it. Unfortunately, it does not do that.
>How-To-Repeat:
If you run this:

echo "feeling very dnl today" | m4

As you might expect it just prints "feeling very " because dnl discards the rest of the line.

However, you should be able to run this:

echo "feeling very dnl today" | m4 --undefine dnl

and have it emit "feeling very dnl today", and indeed other implementations of m4 do this. But NetBSD's m4 does not.
>Fix:

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.