From: Andy Parkins <andyparkins@gmail.com>
To: git@vger.kernel.org
Cc: Theodore Tso <tytso@mit.edu>, Junio C Hamano <gitster@pobox.com>,
Daniel Barkalow <barkalow@iabervon.org>
Subject: Re: [PATCH v2] Make fetch-pack a builtin with an internal API
Date: Mon, 9 Jul 2007 16:28:12 +0100 [thread overview]
Message-ID: <200707091628.14377.andyparkins@gmail.com> (raw)
In-Reply-To: <20070709144030.GE16032@thunk.org>
On Monday 2007 July 09, Theodore Tso wrote:
> > "All identifiers beginning with an underscore are reserved for ordinary
> > identifiers (functions, variables, typedefs, enumeration constants) with
> > file
> > scope."
> I think the above does agree with what I said. It says that you can
> use functions, variables, typdefs, enumeration constants (not just
> labels or structure members) WITH FILE SCOPE. I.e., so long as it
> doesn't leak across a .o linkage. So one .o file can use a static
I'm reading it as meaning they are reserved at file scope; not that you can
use them at file scope.
> _my_strdup, and another .o file can use a static _my_strdup, and they
> don't have to worry about multiply defined function conflicts, since
> they are static functions with file or smaller scoping.
Erm, but we're not talking about your own .o files we're talking about
conflicting with the library; what you say would be true for any identifier.
We have no way of guaranteeing that _my_strdup() isn't defined by one of the
standard library headers that have been included. The standard header is
entitled to use underscore identifiers because they have been reserved at
file scope.
Reading a little further into the FAQ you posted, I found the following in the
list of exceptions:
"You may use identifiers consisting of an underscore followed by a digit or
lower case letter for labels and structure/union members."
and
"You may use identifiers consisting of an underscore followed by a digit or
lower case letter at function, block, or prototype scope."
I'm more sure now - you can't use underscore identifiers at file scope.
Regardless, we're just splitting hairs now. We seem to both agree that it's
easiest just to outright not use underscore-prefixed identifiers; so I'm
happy. :-)
Andy
--
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com
prev parent reply other threads:[~2007-07-09 15:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-09 5:10 [PATCH v2] Make fetch-pack a builtin with an internal API Daniel Barkalow
2007-07-09 5:39 ` Junio C Hamano
2007-07-09 6:37 ` Daniel Barkalow
2007-07-09 18:04 ` René Scharfe
2007-07-09 18:16 ` Daniel Barkalow
2007-07-09 11:50 ` Theodore Tso
2007-07-09 13:16 ` Andy Parkins
2007-07-09 14:40 ` Theodore Tso
2007-07-09 15:10 ` Florian Weimer
2007-07-09 15:28 ` Andy Parkins [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200707091628.14377.andyparkins@gmail.com \
--to=andyparkins@gmail.com \
--cc=barkalow@iabervon.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.