NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/60921: m4 --undefine argument does not undefine



The following reply was made to PR bin/60921; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: bin/60921: m4 --undefine argument does not undefine
Date: Sun, 25 Oct 2026 08:52:23 -0000 (UTC)

 gnats-admin%NetBSD.org@localhost ("phil%hagelb.org@localhost via gnats") writes:
 
 >However, you should be able to run this:
 
 >echo "feeling very dnl today" | m4 --undefine dnl
 
 
 No idea it that should be allowed, but the behaviour changed some
 time ago.
 
 Maybe:
 
 diff -p -u -r1.52 main.c
 --- main.c      10 Jun 2026 22:25:02 -0000      1.52
 +++ main.c      25 Oct 2026 08:40:53 -0000
 @@ -228,6 +228,8 @@ main(int argc, char *argv[])
         outfile = NULL;
         resizedivs(MAXOUT);
  
 +       initkwds();
 +
         while ((c = getopt_long(argc, argv, "D:d:EF:GgI:iL:o:PR:Qst:U:v",
             longopts, NULL)) != -1)
                 switch(c) {
 @@ -320,7 +322,6 @@ main(int argc, char *argv[])
         argc -= optind;
         argv += optind;
  
 -       initkwds();
         if (mimic_gnu)
                 setup_builtin("format", FORMATTYPE);
  
 
 which still doesn't resolve the GNU extension 'format'.
 
 For now, it doesn't make sense to request a GNU extension and then
 to undefine (or redefine) it. But with future multiple GNU extensions
 you may want to ask for them but also remove specific ones.
 
 In that case, you need to parse options twice. Once to identify
 '-g' to setup the extension and then to process the other options
 to override the setup.
 
 



Home | Main Index | Thread Index | Old Index