list tends to
favor free software compression methods (gzip, xz, ...) over the
proprietary zip format.
--
Eric Blake ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
ck overflow
>
> I would appreciate being told the simple idiom I am trying to write. Once I
> understand incr() I assume I could use eval(x *2) to produce doubling
Indeed:
define(`count', `0')
define(`count', expr(count * 2))
--
Eric Blake ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
and our public macro
Now, every time you expand count, that results in the expansion of the
current value of _count, as well as code to redefine _count to the next
value. The same trick can be used with expr instead of incr when
operating on the internal macro (basically, incr(value) is short for
expr(value+1)).
--
Eric Blake ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
gnu.org/software/m4/manual/m4.html#Forloop
define(`forloop', `pushdef(`$1', `$2')_forloop($@)popdef(`$1')')dnl
define(`_forloop',
`$4`'ifelse($1, `$3', `', `define(`$1', incr($1))$0($@)')')dnl
define(`__genbit',
`forloop(`__i', ifelse(`$2', `', __bit, `$2'), `$3',
`\t"$1`'__i",
')dnl')dnl
--
Eric Blake ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
t) or changesyntax() (not yet
released):
indir(`$entry')
call printf
indir(`$exit')
but that's not the clean syntax you were looking for. Hope that helps.
--
Eric Blake ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
on. Is this something you would be
interested having in the GNU M4 manual? If so, would you be able to
help refactor this text into an actual patch to the m4 sources?
--
Eric Blake ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Descript
out it.
>
> Besides, we would like to say "thanks a lot!" to the whole team of gnu M4
> maintainers !
>
> Gwenael & Thomas
>
--
Eric Blake ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
want a tgz of our directory ?
Not yet. I don't want to pollute myself by reading your code until we
are certain that copyright considerations are taken care of first.
--
Eric Blake ebl...@redhat.com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
the interest
of protecting the FSF's existing copyright on the current m4 code base,
the M4 package itself is open source and the GPL even guarantees you the
right to make your changes public, just as it guarantees me the right to
choose whether or not to read your changes. I hope I'm
install'. Much as you would do for any GNU software.
Whether or not there is a pre-built version of a newer m4 binary
floating around in the AIX community is something that you would have to
ask AIX folks about, since this list is only concerned with the source
code distribution.
--
Er
d now.
>
> Any reason to not roll up 1.4.17 from the current HEAD of branch-1.4? I'll
> roll it sometime this week unless someone asks me not to :)
Thank you for tackling that!
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
; in m4sugar.m4?
Alas, m4 doesn't provide a push/pop stack of quotes, and m4sugar.m4 is
quite hard-coded to exactly [] as the quoting characters. I'm afraid
you'll have to do manual translation of the macros that interest you
into your preferred quoting style.
--
Eric Blake
.643-c09a1-dirty":*$ ./bootstrap --skip-po
Do NOT use the master branch (1.9a...) for bootstrapping. It is highly
experimental still, and NOT ready for release yet.
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
ok.com owner ever deciding
to become more standards-compliance, which is unlikely).
> I think the conversation should be between the email server maintainers
> (gnu, outlook).
A conversation between server owners won't make a difference. The
problem is not in GNU's servers.
--
Eric
xperimental and nowhere near a release) agrees with you, and did
attempt to add named argument support. But we're a long way off from
ever making it actually useful enough to release; right now, the
development is focused on the stable branch-1.4 branch.
--
Eric Blake eblake redhat co
ed macros with "function"
> behavior (just like some C lowercase macros, eg, isascii), and use
> UPPER_CASE for "pure" macros (simple substitution)?
Again, that's more up to your project, and what you want to document and
maintain for your local use of m4.
--
Eric Bl
not necessarily efficiently). cpp can be abused to emulate Turing
completeness, although it is even hairier than m4's Turing completeness:
https://stackoverflow.com/questions/3136686/is-the-c99-preprocessor-turing-complete
--
Eric Blake eblake redhat com+1-919-301-3266
Li
tasks, merely that all tasks that can be
done in finite resources can be done in that language. You are correct
that different languages have different strengths, and that m4's
strength is in pre-processing tasks, while other tasks easy in many
languages are rather convoluted in m4.
--
27;, `MACRO_1' defined, `MACRO_1' NOT defined)
> m4_ifndef(`MACRO_1', `MACRO_1' NOT defined, `MACRO_1' defined)
>
Yes, if you write your m4_ifndef wrapper as above.
>
> $ cat ifndef-02.m4
> m4_define(`m4_ifndef', `m4_ifdef(`$1', `$3', `$2'
as for
a general-purpose library of m4 composite macros, I don't really know of
anything designed for that purpose.
But we could certainly document an m4_ifndef macro in the M4 manual,
since it would be a useful teaching tool.
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
ars ago on the master
branch. Alas, the master branch is lacking some TLC and is in no shape
for active use without more patches, and backporting that patch to the
stable branch-1.4 is a bit invasive.
http://git.savannah.gnu.org/cgit/m4.git/tree/doc/m4.texi#n656
--
Eric Blake eblake redhat com
teach
input.c how to parse double-quoted strings, and figure out what new
builtin macro to add to be able to toggle whether double-quoted strings
should be treated specially (and even what their delimiter is) from that
point on in the processing.
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
7;re not mandatory to use. But at this point, we can't rip it out of
m4 - there are users that depend on it. The code is designed to not
penalize people that aren't using it.
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
s.
While it can be quite powerful at what it does, there doesn't seem to
be many people flocking to use it. Whether that is because people don't
know about it, or because m4 only fits a niche market, it's hard to
justify adding features when there is already such a low volume of
contribution and a lack of free time on my part to write new patches.
I'd love to review patches from others - but such patches are rarely
submitted.
I _do_ like suggestions for improvement, but with the limited time I
spend on m4, I like it more when those suggestions are accompanied by an
implementation that demonstrate the improvement rather than just
describing it in prose.
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
d obscurity. Anyway, the purpose of
> this post, if anyone still reading, :) is to:
>
> 1) Find out the reasoning (if any) why the original decision was made
> not to always preface builtins with m4_ prefix.
Because GNU m4 was just copying what others had already done, and then
addin
why do you say "was to allow modules" (not "is")? Is modules idea
> thrown out? Is there a list of other ideas for "eventual m4 2.0"?
The problem, as you may have noticed, is lack of developers with enough
free time to push m4 2.0 to completion. Unless that chan
ite such a patch.
http://www.worldcat.org/title/users-guide-to-the-m5-macro-language/oclc/25491290
(Hmm, I know at one point I was able to read a pdf about M5 at no
charge, but can't seem to find a URL for it via a quick search today)
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
e; that includes a pre-built
version of both 'm4' and 'autoconf', along with other tools you will
need to be able to compile software while in Windows. No need to go
through the pain of bootstrapping your system when you can already get
things ready to use.
--
Eric Blake ebl
m4 gpp.m4
> Got object file from memory but can't read symbols: File truncated.
>
A segfault is never good. Can you please post the contents of gpp.m4,
show the exact version of m4 you are testing, and possible provide more
of the backtrace, so that we can debug what went wrong?
--
On 03/03/2015 07:38 AM, Zack Piper wrote:
> On Mon, Mar 02, 2015 at 06:53:56AM -0700, Eric Blake wrote:
>> On 02/28/2015 04:21 PM, Zack Piper wrote:
>>
>>>
>>> Hm, I found out how to do it. Unfortuently it seems to segfault when using
>>> "changewor
You could always build it yourself; 1.4.17 is here:
http://ftp.gnu.org/gnu/m4/
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
quoting rules. Remember that autoconf
intentionally went with [ ] as the quoting characters, because they were
much likely to be balanced in output, as opposed to ` and ' not
occurring in balanced pairs in shell scripts. In fact, choosing 2- or
3-byte quoting strings is even less ambiguous, alt
es quoting tricks to pass a literal $# and $0 to the inner function,
and the inner function that then does the desired define using the
literal strings in the right place.
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
ctly; you may want to use m4 with
changequote done fairly early so that the rest of your scripting can use
quoting more convenient for the shell.
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
GNU Autoconf 2.69 for GNU Autoconf 2.69."
as a result of my repeated bootstrapping).
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
first need to debug why it is
not working for you. 'missing' is maintained by automake, so you may
get more help on that mailing list. Or you could just go ahead and
install 'GNU make' first, and put it on your path ahead of whatever
unusual system make you are using, so that it no longer prints out the
weird FSUM prefixes that confuse the rest of the build chain.
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
> # corresponding '.texi' files
> touch doc/*.info
Another thing to try: can you unpack an older GNU m4 tarball, one that
was generated with automake 1.12 or newer (1.4.16 should fit the bill),
and see if that builds just fine, because it used the older semantics of
'missing' that don't kill the build? If so, another thing to try to
pinpoint the 'missing' script as the culprit would be to reproduce the
unpacking timestamp skews in both 1.4.16 and 1.4.17 working directories,
but then swap the 'missing' script between the two trees, before trying
to build, and see if the swap causes the build failure to migrate to the
build tree with the newer version of 'missing'.
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
f you don't actually have a file named 'zupa'
handy; and particularly since the aclocal usage is trying to use perl's
open("command |") notation, not open("file") notation. Could it also be
a problem with your particular build of perl, or maybe a newer version
of perl has introduced some backwards incompatible change that
autoconf/automake now need to work with?
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
) to pick something
that mixes nicer with shell (the way autoconf picked [] rather than `'
for that very reason).
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
ease help me to know
> whether my requirement is achievable without modifying the .M4 definition
> file?
I'm coming up blank; looks like you'll have to modify your .M4
definition file.
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
unlike the C
preprocessor, m4 does not have a way to identify C strings where macros
are not to be expanded.
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
1.4.18 (2016-12-31) [stable]
** Diagnose --word-regexp as unsupported if it was not configured.
** Preliminary support for OS/2.
** A number of portability improvements inherited from gnulib.
--
Eric Blake
signature.asc
Description: OpenPGP digital signature
een on the list for several years but
gone unreviewed due to lack of development time.
>
> I'm following m4-patches and Eric Blake has uttered several times something
> along "development's going on as long as I manage to find some spare time,"
> and I respect tha
ans the overall
result for a macro name:
define(`concat', `$1$2')dnl
forloop(`i',`1',APP_DOMAINS,
`concat(`VARIABLE_APP_PORT',i)'
)
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
veloper time.
--
Eric Blake eblake redhat com+1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
t the macro output should be indented;
> would be nice to automate.
Sorry; there's the builtin __line__, but that's as fine as the
granularity gets for now. You'd have to patch m4 to add a new builtin
for tracking column position. It sounds like your workaround is the
best
4/m4.html
currently 1.4.18
The EOL of open source software is a tricky thing to predict - there is
no fixed release schedule, and therefore, all the more we can promise is
that a version is not EOL until the next version is released.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
On 07/17/2017 07:08 AM, Eric Blake wrote:
> On 07/17/2017 06:17 AM, anindo.bur...@wellsfargo.com wrote:
>> Hi,
>> Can you please tell me the latest version of GNU M4 and its EOL , also can
>> you please tell me the EOL of all the previous versions of GNU M4.
>
> T
> '
...and it takes this ' to end the quote, resulting in the literal output
"ticks)
"
> $ m4 f
> expandticks (```)
> expandticks (ticks)
>
I don't know what you WANTED to have happen, but m4 did everything you
asked it to do.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
instead patched autoconf itself to avoid some
pointless copying by using smarter iteration in the first place rather
than naive recursion that triggered m4's O(n^2) behaviors.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org |
On 12/29/2017 02:04 AM, Simon Matter wrote:
> Hi,
>
> I just wanted to mention that the m4-latest.tar.* files on
> http://ftp.gnu.org/gnu/m4/ are not the latest but an older version.
Thanks for the report; I'll see if I can figure out how to update the
symlinks properly
multiple passes with different sets of macros?
Yes, producing multiple output files is done by running m4 multiple times.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
a quoted rather than
bare unmatched parenthesis:
define(`c', ``('')
which may be what you want depending on where you expand the macro "c".
In general, life with mismatched parenthesis can be tricky, but it's
puzzlers like that which are fun to help on, so feel free to ask further
related questions.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
separate $ from 0.
And if all else fails (that is, if you come up with situations where
nested quoting doesn't play nicely with what you have), you can always
create a helper macro:
define(`_my_macro', `/$1/ { print $$2 }')
define(`my_macro', `_$0(`$1', 0)')
whe
r-quoted
string for each pattern to be substituted, then removes the
overquotation at the end of the recursion, with the drawback that ^ and
$ anchors don't work quite as expected (but your example sed script did
not use anchors).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
f you paste what you've tried.
Note that one-character quotes that might occur imbalanced in your text
are inherently difficult to manage correctly through pattern
substitutions; using a two-character quote delimiter that is unlikely to
appear in any of the text you are processing can make life much easier
(I chose [[ and ]]).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
ot with your lack of proper quoting. And the builtin can handle any
two strings, not just strings that are valid as part of a macro name.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
ovide a warning to
the end user). So unless you are planning on preserving the perl wrapper
around m4, there is not much point in porting the m4sugar language to
pure m4.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
nd line -d argument can control. Thus, your solution is to define
a wrapper around the 'include' macro which temporarily turns off
debugging, includes the file, then reinstates debugging.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtu
ing that things build locally, but that does indeed mean
that things can slip in affecting other platforms that a CI system would
catch, so I'm not opposed to using one. But at the same time, I don't
have the resources to administer a CI system myself.
--
Eric Blake, Principal Softw
gt;
> https://github.com/habitat-sh/core-plans/blob/master/m4/fix-test-getopt-posix-with-glibc-2.26.patch
Thanks; I guess it means I need to look into releasing an updated m4
against a newer gnulib.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtua
. Otherwise,
we're completely guessing as to what you did and why it triggered some
unspecified error. In all likelihood, the problem is not a bug in m4
but a misunderstanding on your part about how to use it.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301
f $,
which may introduce its own oddities if the user supplied a macro
definition containing $ that you aren't expanding as a macro.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
er.hideRefs'
> looks like it might be worth investigating, but I'm not certain.
>
> * Run the following in the bare repository; it should help the user out
> by informing 'git clone' which branch to set up as the default:
>
> $ git symbolic
by default.
** Introduce the use of gettext, with the immediate benefit of nicer
UTF-8 author names. Over time, more translations of program messages
will become available.
** A number of portability improvements inherited from gnulib.
--
Eric Blake, on behalf of the GNU M4 team
get 1.4.19 out the door this month.
[3] https://lists.gnu.org/archive/html/bug-m4/2021-03/msg00006.html
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
n the suggested gnupload instructions it generates?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
On 5/8/21 6:34 AM, Eric Blake wrote:
> but it would be a lot nicer if I didn't have to remember to do that
> after the fact. In fact, reading gnupload --help says it is as simple
> as calling:
>
> $ gnupload --to ... --symlink-regex ...
>
> in the first place.
g.net --recv-keys A7A16B4A2527436A
and rerun the 'gpg --verify' command.
This release was bootstrapped with the following tools:
Autoconf 2.69
Automake 1.16.2
Gnulib v0.1-4618-gc499a3c497
NEWS
* Noteworthy changes in release 1.4.18d (2021-05-11) [beta]
** A number of portabili
On 5/11/21 9:44 AM, Eric Blake wrote:
> Hello M4 users,
>
> GNU M4 1.4.18d has been released. This release is a minor update, and
> is marked beta in order to give translators the time to upload
> translations before the stable 1.4.19 is released later this month. The
> b
On 5/8/21 5:53 AM, Eric Blake wrote:
> The following beta release includes a new m4.pot, where we would like to
> reinstate the m4 translation domain with disclaimers required (since FSF
> owns M4 copyright):
>
> file m4-1.4.18b/po/m4.pot within
> https://alpha.gnu.org/gnu/m4
> Op 11-05-2021 om 17:08 schreef Eric Blake:
>> m4.pot has been updated with many more strings as part of
>> 1.4.18d.tar.xz, announced at
>> https://lists.gnu.org/archive/html/m4-discuss/2021-05/msg2.html
>
> Ehm... you mean:
>
> https://lists.gnu.or
copyright assignment. Certainly not something that will happen in
time for the pending 1.4.19 release, but if there is didactic value in
your macros that is not already covered in the manual, it may be worth
future consideration.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
beta has had enough
soak time to get a few translation files submitted).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
509, as
modern systems have enough memory to benefit from fewer hash collisions
by default.
** Introduce the use of gettext, with the immediate benefit of nicer
UTF-8 author names. Over time, more translations of program messages
will become available.
** A number of portability i
he identifier __stat for our own uses now that we know system
headers are using it. Once it is fixed there, I need to do another m4
release anyways (1.4.19 has a bug with unintended locale sensitivity
when it comes to parsing numbers), so eventually when I get the time,
the 1.4.20 release wil
in contact with
people more familiar with your choice of toolchain.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
lines]
> Lbump(counter)2:
In your definition, you did not separate `L' from `bump', so m4 tried
to expand the `Lbump' macro (undefined, so output as-is), then
stripped the nested quotes.
> mvi a, 3
>
> Instead I need:
>
> L2:
>
; of the mkv macro expansion? That way, instead of matching "mkv", it would
> match ".mkv".
If you are asking "can m4 treat '.mkv' as a macro name", the answer is
no for m4 1.4 unless it was built with --enable-changeword (which
penalizes speed performance
gt; > > "mkv", it would match ".mkv".
> >
> > If you are asking "can m4 treat '.mkv' as a macro name", the answer is
> > no for m4 1.4 unless it was built with --enable-changeword (which
> > penalizes speed performance). But
llowing (note that when I
write m4 code to interact with shell snippets, I prefer to use
changequote to something less likely to trip up on shell syntax than
m4's default of `'):
changequote([, ])dnl
define([body_h], ...m4 code to produce contents for file.h...)dnl
define([body_c], ...m4 code
to
know what is actually going on - you didn't paste any actual terminal
command lines, only one error message; you haven't even mentioned
whether you are using WSL, Cygwin, MSYS, or some other Unix-like
environment on Windows - so I can't even tell you have to modify PATH.
--
Eric Bla
avior of prioritizing argument collection over macro expansion
output (I just tested FreeBSD's m4 at
https://instantworkstation.com/virtual-machine to confirm).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
#x27;, `realdnl`'')dnl() see what I just did?
define(`realundefine', defn(`undefine'))dnl
define(`undefine', `ifelse(`$#', 0, `errprint(`m4:'__file__:__line__`: Warning:
missing argument to `$0'
')', `realundefine($@)')')
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
e
unlikely to be in the middle of the included file - at which point you
can now treat the entire input file as a single m4 comment which
undergoes no further expansion, then trim off your suffix sequence as
you sanitize the data. But then you are at the issue of how you
detect those first few bytes; perhaps syscmd or esyscmd can be used
for that, although it's another set of interesting language barriers
when you try to write m4 that produces valid shell code for grabbing
untrusted bytes in a sanitized manner.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
iteration, such as
pushdef stacks or by the use of GNU m4 extensions such as patsubst()
or the ability to address $10 and beyond (POSIX only requires support
for addressing up to $9, anything greater requires shift) to rewrite
long $@ lists into O(N) processing in m4sugar's m4_foreach.
--
m should have been fixed by upgrading to
more recent gnulib. If it is still broken on the tip of branch-1.4,
that is something that will need to be fixed before 1.4.20 is
released. I haven't hit a libsigsegv link failure on my development
machine, but part of the release process is trying to build elsewhere.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
, line 8, in
sys.exit(main())
^^
File "/home/eblake/m4p/m4p/main.py", line 27, in main
_main()
File "/home/eblake/m4p/m4p/main.py", line 102, in _main
parser.parse()
File "/home/eblake/m4p/m4p/parser.py", line 511, in parse
args = self.consume_arguments()
... ~2500 lines later...
RecursionError: maximum recursion depth exceeded
120
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
ream
ModuleNotFoundError: No module named 'm4p'
Maybe it's my naivete with python, but unless I can figure out how to
run your code, I can't compare it against the C version to spot out
where you are still incomplete in your implementation.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
. Autoconf needs GNU 'm4' for generating
'configure' scripts, but not for running them.
There have been 69 commits by 4 people in the 206 weeks since 1.4.19.
See the NEWS below for a brief summary.
Thanks to everyone who has contributed!
The following people contributed changes
. I have not had any
> benchmarks, but from roughly looking at
> how long tests take I'm measuring a 100x slowdown. I'm hoping to
> rewrite it in Rust later to address that.
>
> Regards,
> Nikolaos Chatzikonstantinou
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
will find that you need to tweak m4p's eval
to match:
$ m4
eval(-1%3)
-1
eval((0x7fff+2)%3)
-1
$ m4p
eval(-1%3)
2
eval((0x7fff+2)%3)
0
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
alue
diff --git i/m4p/parser.py w/m4p/parser.py
index c387e1a..175df28 100644
--- i/m4p/parser.py
+++ w/m4p/parser.py
@@ -862,13 +862,17 @@ class Parser:
self.info(
pathname, line, b"divide by zero in eval: %b" %
arg_expression
)
+case CalcInfo.MOD_BY_ZERO:
+self.info(
+pathname, line, b"modulo by zero in eval: %b" %
arg_expression
+)
case CalcInfo.NEGATIVE_EXP:
self.info(
pathname,
line,
b"negative exponent in eval: %b" % arg_expression,
)
-case CalcInfo.INVALID_UNARY_OP | CalcInfo.INVALID_BINARY_OP:
+case CalcInfo.INVALID_OP:
self.returncode = 1
self.info(
pathname, line, b"invalid operator in eval: %b" %
arg_expression
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
On Mon, May 12, 2025 at 09:16:29AM -0500, Eric Blake wrote:
> [Dropping automake; at this point, m4-discuss is the best place to
> discuss how m4p is progressing]
>
Another bug you need to fix:
$ echo divnum | m4p
1
$ echo m4_divnum | m4p -P
$
all of the builtins appear to be broken w
d when I get back home.
Another one that is hopefully easy:
$ printf 'divert(2)2\ndivert(1)1\n' | m4
1
2
$ printf 'divert(2)2\ndivert(1)1\n' | m4p
$
Non-negative diversions are not being dumped automatically at end of input.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
On Mon, May 12, 2025 at 10:24:12AM -0500, Eric Blake wrote:
> On Mon, May 12, 2025 at 09:54:54AM -0500, Nikolaos Chatzikonstantinou wrote:
> > > $ echo 'eval(1 || (1/0))' | m4-1.4.20
> > > 1
> > > $ echo 'eval(1 || (1/0))' | m4p
> >
define(`a', defn(`defn'))dnl
dumpdef(`a')
a:
dumpdef(a)
a:
$ m4p
dumpdef(`defn')
defn:
define(`a', defn(`defn'))dnl
dumpdef(`a')
m4:stdin:4: undefined macro `'
dumpdef(a)
a:
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
b A
$ m4p
define(a,A)define(b,defn(`defn'))define(c,b(`a'))dnl
a b c
A A
which may be related to how you output the empty string for
builtin(`defn') while still outputting "`defn'" for defn directly
invoked with zero arguments.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
t;credits" or "license" for more information.
>>> import pygnuregex
>>> pygnuregex.compile(b"a")
Segmentation fault (core dumped)
(.venv)
--
Eric Blake, Principal Software Engineer
Red Hat, Inc.
Virtualization: qemu.org | libguestfs.org
ximately:
m4 1.4.19: 100ms
m4 1.4.20:60ms# Faster, because I improved eval
branch-1.6: 10ms# Faster, because I improved shift($@) iteration
m4p:9631ms
More importantly, if I double the number in forloop from 1000 to 2000,
I see:
m4 1.4.19:270ms# More than double - shift
201 - 300 of 329 matches
Mail list logo