cvs commit: src/include fnmatch.h

Bruce Evans bde at zeta.org.au
Wed Dec 17 19:35:02 PST 2003


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


More information about the cvs-src mailing list