I tortured myself with enough m4 to unlock a legacy bug:

The defn macro is supposed to give a user-defined macro's definition enclosed in the current quote strings. It actually gives that enclosed in only the first byte of each quote string instead, thus not properly quoted. This is never a problem unless you changequote to multi-character strings. Guess what I do.

The workaround is using ifdef instead.

Tested in Heirloom Project & Dell UNIX System V.4 Issue 2.2.

Follow

Thanks to Infinite Mac, I found out the reason defn has that bug is because in even older m4 versions, such as those in NeXTStep & OpenStep, the changequote macro sets the quote strings to only the first byte of its argument strings, not up to 5 bytes each, and its manpages imply this.

And it went either undiscovered or unremarked because what kind of masochistic idiot would want multi-character quote strings, i.e. more typing, in m4 anyway?

Sign in to participate in the conversation
Computer Fairies

Computer Fairies is a Mastodon instance that aims to be as queer, friendly and furry as possible. We welcome all kinds of computer fairies!