bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] Re: linebreak.c proposed patches for size-calculation overf


From: Paul Eggert
Subject: [Bug-gnulib] Re: linebreak.c proposed patches for size-calculation overflows
Date: 19 Nov 2003 01:04:34 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Simon Josefsson <address@hidden> writes:

> I have considered the '_t' suffix for types philosophically related to
> hungarian notion (and thus avoided it).  What are the opinions on
> using 'foo_t' or 'foo' for new typedef's in a library?

Opinions differ.  :-)

Personally I dislike the "_t" suffix because of my aversion to
Hungarian notation, though I understand somewhat the need for it given
the limitations of C's syntax (where user-defined types are a
syntactically weird notion).

Another argument for avoiding _t in user-defined typedefs is that such
names are reserved by POSIX and or Standard C (I forget which).

> Another option I have considered is to not use typedef at all, but
> rather write 'struct foo *foo' instead of 'foo *foo' or 'foo_t *foo'.
> (I got that idea from GNU lsh.)

The main objection to that is that it requires foo to be a struct
type; if you later change foo to be some other kind of type you'll be
stuck.  Other than that it's fine.  In a way it's nicer since struct
tags are a separate namespace.

> The Emacs font locking mechanism appear to work better with 'foo_t
> *foo' in some situations

Hmm, OK, well, I don't use that part of Emacs at all.  (I'm a
throwback who prefers monochrome displays.  :-)




reply via email to

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