bug-m4
[Top][All Lists]
Advanced

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

Re: --synclines adds #line 4711 after #define xyz(abc) ...\


From: Eric Blake
Subject: Re: --synclines adds #line 4711 after #define xyz(abc) ...\
Date: Wed, 26 May 2021 10:09:44 -0500
User-agent: NeoMutt/20210205

On Sat, Dec 26, 2020 at 06:26:42PM +0000, Kadlec, Albrecht wrote:
> Hi,
> 
> We are using GNU m4 1.4.18:  are there any plans for extensions a'la a c-mode 
> via
> -synclines=c,'#line __line__ "__file__"'
> (also defining the lead-in per file) to add line-continuation awareness and 
> maybe even comment awareness ?
> Or a function
> syncline(`#line '__line__ "__file__")
> to enable switching on/off/changing the syntax?
> Do you accept up-streaming contributions? -> next deadline/release?

Contributions are okay if you are willing to assign copyright to the
FSF; however, I must be fair and warn you that a contribution to teach
m4 how to report dependency tracking more like gcc has now stalled for
several years, because there has been very little active development
on m4.

Adding new macros must be done carefully (we don't want to break
existing use of m4 where the new macro name had other purposes).
Also, POSIX is fairly vague at what synclines do, stating only:

> The following options shall be supported:
> 
> -s
>     Enable line synchronization output for the c99 preprocessor phase (that 
> is, #line directives).
[https://pubs.opengroup.org/onlinepubs/9699919799/utilities/m4.html]

with no mention of what format those lines must take (either on the
description for m4, or for c99).  But changing their output is also a
risk if it is not done as an opt-in manner, so figuring out how to
opt-in (or even if opting in is possible for a given build of m4)
needs to be thought about.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]