Date: Thu, 18 Dec 2003 03:35:02 -0000 From: Bruce Evans <bde@zeta.org.au> To: Nate Lawson <nate@root.org> Cc: cvs-src@FreeBSD.org Subject: Re: cvs commit: src/include fnmatch.h Message-ID: <20031218141559.L18573@gamplex.bde.org> In-Reply-To: <20031216234451.B68813@root.org> References: <20031217025442.D3EA816A54F@hub.freebsd.org> <20031216234451.B68813@root.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 16 Dec 2003, Nate Lawson wrote: > On Tue, 16 Dec 2003, Jordan K. Hubbard wrote: > > FreeBSD src repository > > > > Modified files: > > include fnmatch.h > > Log: > > Conformance: Define FNM_NOSYS (see http://www.opengroup.org/onlinepubs/007904975/basedefs/fnmatch.h.html) > > > > Revision Changes Path > > 1.12 +2 -0 src/include/fnmatch.h > > > > Index: src/include/fnmatch.h > > diff -u src/include/fnmatch.h:1.11 src/include/fnmatch.h:1.12 > > --- src/include/fnmatch.h:1.11 Tue Sep 17 15:25:40 2002 > > +++ src/include/fnmatch.h Tue Dec 16 18:54:29 2003 > > @@ -44,6 +44,8 @@ > > #define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ > > #define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ > > #define FNM_PERIOD 0x04 /* Period must be matched by period. */ > > + > > +#define FNM_NOSYS -1 /* Reserved */ > > > > #if __BSD_VISIBLE > > #define FNM_LEADING_DIR 0x08 /* Ignore /<tail> after Imatch. */ > > Lack of tabs? There are some other bugs in this commit. In order of importance: - namespace pollution. The new macro is an XSI mistak^Wextension in POSIX. It should be under an _XSI_VISIBLE ifdef like most other XSI extensions. - missing parentheses around macro. While there may be no conforming uses of the macro where this matters, it is routine header engineering to fully parenthesize macros. The corresponding parentheses are not missing for the EOF macro in <stdio.h>, though using EOF in contexts where the parentheses make a difference would be almost as weird as using FNM_NOSYS in such contexts. - new macro in a section all by itself. In POSIX it is together with the other macros but it is marked up as being an obsolescent XSI extension. This won't be a bug when the namespace pollution is fixed -- the ifdef will naturally create a separate section. - missing "." in the comment, unlike in the comments on all the other FNM_* macros. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031218141559.L18573>