[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] Strange error messages from Groff 1.22.3
From: |
Jones, Larry |
Subject: |
Re: [Groff] Strange error messages from Groff 1.22.3 |
Date: |
Fri, 21 Nov 2014 21:27:43 +0000 |
Ralph Corderoy writes:
>
> 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, https://talks.golang.org/2012/splash.article#TOC_5.
> (That dot is part of the anchor.)
That's a crock. Users shouldn't have to figure out the transitive closure of
all the recursively required headers and then do a topological sort to get them
in the right order, headers should just include the other headers that they
require and let the compiler sort it out. It's not very difficult for a
compiler/preprocessor to detect that a header is idempotent and not read it
multiple times; GCC has been doing it for at least 10 years, if not 20. (See
https://gcc.gnu.org/onlinedocs/cppinternals/Guard-Macros.html.)
-Larry Jones
- Re: [Groff] Strange error messages from Groff 1.22.3, (continued)
- Re: [Groff] Strange error messages from Groff 1.22.3, Eli Zaretskii, 2014/11/11
- Re: [Groff] Strange error messages from Groff 1.22.3, Eli Zaretskii, 2014/11/11
- Re: [Groff] Strange error messages from Groff 1.22.3, Eli Zaretskii, 2014/11/17
- Re: [Groff] Strange error messages from Groff 1.22.3, Werner LEMBERG, 2014/11/19
- Re: [Groff] Strange error messages from Groff 1.22.3, Eli Zaretskii, 2014/11/20
- Re: [Groff] Strange error messages from Groff 1.22.3, Werner LEMBERG, 2014/11/20
- Re: [Groff] Strange error messages from Groff 1.22.3, Keith Marshall, 2014/11/20
- Re: [Groff] Strange error messages from Groff 1.22.3, Eli Zaretskii, 2014/11/20
- Re: [Groff] Strange error messages from Groff 1.22.3, Werner LEMBERG, 2014/11/21
- Re: [Groff] Strange error messages from Groff 1.22.3, Ralph Corderoy, 2014/11/21
- Re: [Groff] Strange error messages from Groff 1.22.3,
Jones, Larry <=
- Re: [Groff] Strange error messages from Groff 1.22.3, Mike Bianchi, 2014/11/21
- Re: [Groff] Strange error messages from Groff 1.22.3, Eli Zaretskii, 2014/11/22
- Re: [Groff] Strange error messages from Groff 1.22.3, Werner LEMBERG, 2014/11/22
- Re: [Groff] Strange error messages from Groff 1.22.3, Eli Zaretskii, 2014/11/22
- Re: [Groff] Strange error messages from Groff 1.22.3, Keith Marshall, 2014/11/22
- Re: [Groff] Strange error messages from Groff 1.22.3, Keith Marshall, 2014/11/08
- Re: [Groff] Strange error messages from Groff 1.22.3, Eli Zaretskii, 2014/11/08
Re: [Groff] Strange error messages from Groff 1.22.3, Doug McIlroy, 2014/11/09