m4-discuss
[Top][All Lists]
Advanced

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

whitespace vs. POSIX


From: Eric Blake
Subject: whitespace vs. POSIX
Date: Sat, 21 Oct 2006 19:56:55 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.7) Gecko/20060909 Thunderbird/1.5.0.7 Mnenhy/0.7.4.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

POSIX is explicit that only <blank>s and <newline>s may be discarded when
collecting macro arguments (ie. space, \t, and \n).  However, I just filed
an aardvark, since GNU m4, FreeBSD [1], and heirloom-devtools (based on
OpenSolaris) [2] all use isspace() instead of isblank() to do the
filtering (ie. blanks, but also \f, \v, and \r).  For an example,

$ printf 'len(\f)
' | m4

should output 1 per a strict reading of POSIX, but outputs 0 on every
implementation I have access to.  I will wait until the Austin group makes
a ruling on my aardvark before deciding whether it is worth patching GNU
m4 to use isblank() instead of isspace() when POSIXLY_CORRECT.

[1]
http://cvsup.pt.freebsd.org/cgi-bin/cvsweb/cvsweb.cgi/src/usr.bin/m4/main.c?rev=1.26&content-type=text/x-cvsweb-markup
[2]
http://heirloom.cvs.sourceforge.net/heirloom/heirloom-devtools/m4/m4.h?revision=1.1&view=markup

- --
Life is short - so eat dessert first!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFOs/n84KuGfSFAYARAjzDAJ4yMzH7uUqw4/Z0tPvYh3SPYpuTBQCdGLO1
A2Xmxse5xpEyoIl9VqrbWHk=
=h78s
-----END PGP SIGNATURE-----




reply via email to

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