On Sat, May 17, 2025 at 07:35:08AM -0500, Eric Blake via M4-patches wrote: > * doc/m4.texi (Eval): Mention that the shift amount of << and >> is > implicity truncated. Mention that radix > 10 can cause macro expansion. > Enhance unit tests to cover this. > --- > doc/m4.texi | 21 +++++++++++++++++---- > 1 file changed, 17 insertions(+), 4 deletions(-) > > diff --git a/doc/m4.texi b/doc/m4.texi > index 81476bc8..5a7980e7 100644 > --- a/doc/m4.texi > +++ b/doc/m4.texi > @@ -7152,7 +7152,9 @@ Eval > aware that parentheses may be required to enforce C precedence rules. > Likewise, division by zero, even in the unused branch of a > short-circuiting operator, is not always well-defined in other > -implementations. > +implementations. While GNU M4 implicitly masks the right argument > +of a shift operator to 5 bits, other implementations may have undefined > +behavior for a negative argument or a positive argument greater than 31.
Oops, I should have read further; the manual already has a paragraph on this. The rest of the patch is okay, though. -- Eric Blake, Principal Software Engineer Red Hat, Inc. Virtualization: qemu.org | libguestfs.org _______________________________________________ M4-patches mailing list [email protected] https://lists.gnu.org/mailman/listinfo/m4-patches
