bug-gnulib
[Top][All Lists]
Advanced

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

Re: underscores in gnulib file names


From: Jim Meyering
Subject: Re: underscores in gnulib file names
Date: Fri, 07 Sep 2007 08:15:12 +0200

Bruno Haible <address@hidden> wrote:

> Hi Paul,
>
>> RMS writes:
>>
>> > Our convention is to use dashes, not underscores.
>> > The names getopt_.h and getopt_int.h don't follow
>> > this convention.

I'm open to such a change.
I admit that .eh seems a little odd, and would
require everyone to teach their editor about the new suffix.
How about the "..h" suffix, e.g., stdlib..h?  Do we care enough
about 8.3 limitations to worry about that?

> Where does this "convention" come from? It's the first time I hear about
> such a bizarre requirement.

It's not that bizarre, and it's been present in the GNU culture
for a very long time.  "-" is easier to type than "_", since
the former is a single key-press and the latter usually requires two.
Perhaps the fact that it is not as well known as it should be is
the reason there are so many exceptions.  And not everyone is willing
to adhere to such conventions.  For example, I recall having to
do extra work to make autoconf perform a small transformation to
obtain the group-member.c name rather than group_member.c.

It's even been raised in gnulib reviews of new files -- at least,
I recall telling others about this particular guideline when they
proposed adding a file containing a "_".  Obviously I haven't told
everyone: getopt_int.h sounds like something from libc, so no point
in bothering, there.  The foo_.h names are a little different.  There,
the "_" is less of a word separator than a suffix, so it doesn't seem
to break the rules as flagrantly.  Besides, it's a header file, and I
tend to type their names less.  At least those particular cases don't
bother me as much as say, foo_bar.c would.

I see it's not specifically mentioned in standards.info.
Maybe someone will add it, there.

> POSIX does not specify the existence of an include file with a dash, but
> does specify that an include file with an underscore must exist: <nl_types.h>.
>
> The glibc sources contain more files with an underscore (3288) than files
> with a dash (2270).

glibc is very nice software, but it is not a model
of adherence to GNU or portability standards.




reply via email to

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