[Nut-upsdev] coding style

Peter Selinger selinger at mathstat.dal.ca
Thu Feb 15 22:51:42 CET 2007


Carlos Rodrigues wrote:
> 
> On 2/8/07, Peter Selinger <selinger at mathstat.dal.ca> wrote:
> > Dear developers,
> >
> > I would like to make the following additions to the section on coding
> > style to developers.txt. Any objections / comments ?
> >
> > -- Peter
> >
> > Index: docs/developers.txt
> > ===================================================================
> > --- docs/developers.txt (revision 799)
> > +++ docs/developers.txt (working copy)
> > @@ -154,6 +154,10 @@
> >  off the right margin of the screen, expect them to meet the byte
> >  chainsaw sooner or later.
> >
> > +All types defined with typedef should end in "_t", because this is
> > +easier to read, and it enables tools (such as indent and emacs) to
> > +format the source code correctly.
> 
> I don't oppose to this, but let me point out that the glibc manual
> discourages the use of "_t" names for types in user code:
> 
> http://www.gnu.org/software/libc/manual/html_node/Reserved-Names.html#Reserved-Names

Interesting; I didn't know this. However, this would not cause any
harm until a future extension of the C language or POSIX defines types
of those names. In this case, we can easily change our names.

-- Peter



More information about the Nut-upsdev mailing list