git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* The MIT error
@ 2005-10-24 18:57 Morten Welinder
  2005-10-25 13:40 ` Horst von Brand
  0 siblings, 1 reply; 4+ messages in thread
From: Morten Welinder @ 2005-10-24 18:57 UTC (permalink / raw)
  To: GIT Mailing List

After the isspace/BSD conflict I looked into what reserved symbols are
being used by git.  Quite a few, it turns out.

--M.


The C standard says you should not use identifiers matching:

    (is|to)[a-z].*                         <-- such as isize
    E[0-9A-Z].*                         <-- such as EMIT
    str[a-z].*                              <-- such as strbuf
    (PRI|SCN)[a-zX].*
    LC_[A-Z].*
    (SIG|SIG_)[A-Z].*
    (uint|int).*_t
    (UINT|INT).*_(MIN|MAX|C)
    wcs[a-z].*

The three top ones are the easiest to violate.  While fixing the existing
violations is probably pointless, new code ought not make things worse.

Just as isspace is reserved by the C implementation...

       7.26.2  Character handling <ctype.h>

       [#1]  Function  names that begin with either is or to, and a
       lowercase letter (possibly followed by  any  combination  of
       digits,  letters,  and  underscore)  may  be  added  to  the
       declarations in the <ctype.h> header.

[so there goes any use of "isize"], so are macro names EMIT, ETHIS,
and ETHAT, at least when <errno.h> is included.

      7.26.3  Errors <errno.h>

       [#1] Macros that begin with E  and  a  digit  or  E  and  an
       uppercase  letter  (possibly  followed by any combination of
       digits,  letters,  and  underscore)  may  be  added  to  the
       declarations in the <errno.h> header.

quote.c:#undef EMIT
quote.c:#define EMIT(x) ( (++len < n) && (*bp++ = (x)) )
quote.c:#define EMITQ() EMIT('\\')
server-info.c:#define EMITTED   04
tar-tree.c:#define EXT_HEADER_PATH              1
tar-tree.c:#define EXT_HEADER_LINKPATH  2
ls-files.c:#define EXC_CMDL 0
ls-files.c:#define EXC_DIRS 1
ls-files.c:#define EXC_FILE 2
epoch.h:#define EPOCH_H
update-index.c:static inline void *ERR_PTR(long error)

        7.26.10  General utilities <stdlib.h>

       [#1] Function names that begin  with  str  and  a  lowercase
       letter  (possibly  followed  by  any  combination of digits,
       letters, and underscore) may be added to the declarations in
       the <stdlib.h> header.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-10-25 16:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-24 18:57 The MIT error Morten Welinder
2005-10-25 13:40 ` Horst von Brand
2005-10-25 13:52   ` Andreas Ericsson
2005-10-25 16:50     ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).