[Top][All Lists]

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

Re: [Groff] Strange error messages from Groff 1.22.3

From: Ralph Corderoy
Subject: Re: [Groff] Strange error messages from Groff 1.22.3
Date: Fri, 21 Nov 2014 13:24:36 +0000

Hi Werner,

> > It's IMO a Groff problem that is not specific to MinGW:
> > stringclass.h is not idempotent.
> Indeed, this is true for (almost) all groff header files.  For some
> reason, Clark decided to code it that way, not providing guards
> against loading header files multiple times.  I haven't changed that.

Gets my vote.  :-)  It's a Bell Labs style of programming seen widely in
Plan 9.  Rob Pike has also written about it since the 1980s.  Header
files should not be #include'd multiple times;  nor should they #include
others.  They should state their needs and be #include'd once in the
C(++) file, in an appropriate order.  Guards are verboten.

One example:

    The construction of a single C++ binary at Google can open and read
    hundreds of individual header files tens of thousands of times.  In 2007,
    build engineers at Google instrumented the compilation of a major Google
    binary.  The file contained about two thousand files that, if simply
    concatenated together, totaled 4.2 megabytes.  By the time the #includes
    had been expanded, over 8 gigabytes were being delivered to the input of
    the compiler, a blow-up of 2000 bytes for every C++ source byte.
        -- Rob Pike,
            (That dot is part of the anchor.)

Cheers, Ralph.

reply via email to

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