[Top][All Lists]

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

Re: [Groff] Using C with glib instead of C++ for groff

From: Werner LEMBERG
Subject: Re: [Groff] Using C with glib instead of C++ for groff
Date: Thu, 28 Nov 2002 08:25:47 +0100 (CET)

> The actual source of groff uses a simplified C++ which could be
> critical on some non-Linux systems or some future C++ changings.
> For example, it is planned to replace `static' by `namespace'
> concepts; groff does not use namespaces because of difficulties with
> some compilers.

It should be straightforward to provide a preprocessor macro to
select the right syntax.

> An alternative for groff version 2 will be to use the `glib'
> library; glib completely works in C, but provides several C++-like
> quasi-objective elements.  The glib library exists on almost all
> operating systems, including all Unix-like systems, Microsoft, and
> Mac.  So it would make sense to use it for implementing the unicode
> structures for groff.

Hmm, depending on another library is not something I really like...

> For example, the file groff-current/src/libs/libdriver/ has
> some problems with the integer length of some variables.  Although 32
> bits are necessary for some constructs, the file only uses `int' as
> type.  `int' is on GNU PC's wide enough with 32 bits, and `long' is
> too large with 64 bits.  But in ANSI C, `int' has 16 bits and `long'
> has 32 bits.

I think this is not correct.  AFAIK, ANSI C says that `int' has *at
least* 16 bits.  Antoine, can you give a definite answer?

groff assumes that `int' is at least 32bit.  It might be worth to add
a test to the configure script which tests this, but honestly I doubt
that this will ever be a problem.


reply via email to

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