diff options
author | Arsen Arsenović <arsen@aarsen.me> | 2023-02-23 11:27:11 +0100 |
---|---|---|
committer | Gerald Pfeifer <gerald@pfeifer.com> | 2023-02-23 23:42:01 +0100 |
commit | f33d7a88d069d169bbe76da8e5c52de17f68ca05 (patch) | |
tree | 6d399142c972278067733d030a73fb2e807af488 /gcc/doc/cpp.texi | |
parent | f83e76c3f998c8708fe2ddca16ae3f317c39c37a (diff) | |
download | gcc-f33d7a88d069d169bbe76da8e5c52de17f68ca05.zip gcc-f33d7a88d069d169bbe76da8e5c52de17f68ca05.tar.gz gcc-f33d7a88d069d169bbe76da8e5c52de17f68ca05.tar.bz2 |
**/*.texi: Reorder index entries
This change is a generalization of r13-6292-gddf6fe375d9110.
Historically, makeinfo exhibited a bug, due to which a structure like:
@item foo
@cindex foo
@cindex bar
... would be transformed into an item heading, with the first index
entry on it, followed by an item body, with the second index entry in
it. This has often lead to index entries not linking to relevant items,
but rather, just below them.
This bug was exhibited in both Info and HTML documentation, and was most
glaringly obvious in the latter.
After a discussion with the Texinfo developers, it was decided that the
appropriate construct for this case is:
@cindex foo
@cindex bar
@item foo
... which behaves correctly in newer versions, linking all the index
entries to the item itself. This pattern also produces copiable
anchors in HTML output.
This commit fixes most indices to follow the pattern above, however,
omits relevant changes in the Ada manuals, as the algorithm described
below lead to many false positives and unwanted changes in that manual.
Much like the previous commit, this change is mostly mechanical, with a
simple script. I have, however, gone over the patch myself also, to see
if there's anything that ought to be kept as-is. Formatter:
# GPL3+
use v5.35;
use strict;
use warnings;
my @lineq = ();
my @itemq = ();
my @indxq = ();
my $lstin = 0;
while (<>)
{
push (@lineq, $_);
if (/^\@[a-zA-Z0-9]{1,2}index\W/)
{
$lstin = @lineq;
push (@indxq, $_);
next;
}
if (/^\@itemx?\W/)
{
$lstin = @lineq;
push (@itemq, $_);
next;
}
next if $lstin && /^\s*(\@c(omment)?\W.*)?$/;
if (@indxq and @itemq)
{
print @indxq;
print @itemq;
print @lineq[$lstin..@lineq-1];
}
else
{
print @lineq;
}
@lineq = ();
@itemq = ();
@indxq = ();
$lstin = 0;
}
if (@indxq and @itemq)
{
print @indxq;
print @itemq;
print @lineq[$lstin..@lineq-1];
}
else
{
print @lineq;
}
# Local Variables:
# indent-tabs-mode: nil
# End:
gcc/d/ChangeLog:
* implement-d.texi: Reorder index entries around @items.
gcc/ChangeLog:
* doc/cfg.texi: Reorder index entries around @items.
* doc/cpp.texi: Ditto.
* doc/cppenv.texi: Ditto.
* doc/cppopts.texi: Ditto.
* doc/generic.texi: Ditto.
* doc/install.texi: Ditto.
* doc/extend.texi: Ditto.
* doc/invoke.texi: Ditto.
* doc/md.texi: Ditto.
* doc/rtl.texi: Ditto.
* doc/tm.texi.in: Ditto.
* doc/trouble.texi: Ditto.
* doc/tm.texi: Regenerate.
gcc/fortran/ChangeLog:
* invoke.texi: Reorder index entries around @items.
gcc/go/ChangeLog:
* gccgo.texi: Reorder index entries around @items.
Diffstat (limited to 'gcc/doc/cpp.texi')
-rw-r--r-- | gcc/doc/cpp.texi | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi index 5361674..b0a2ce3 100644 --- a/gcc/doc/cpp.texi +++ b/gcc/doc/cpp.texi @@ -292,8 +292,8 @@ roughly to the first three ``phases of translation'' described in the C standard. @enumerate -@item @cindex line endings +@item The input file is read into memory and broken into lines. Different systems use different conventions to indicate the end of a @@ -312,8 +312,8 @@ of the file is considered to implicitly supply one. The C standard says that this condition provokes undefined behavior, so GCC will emit a warning message. -@item @cindex trigraphs +@item @anchor{trigraphs}If trigraphs are enabled, they are replaced by their corresponding single characters. By default GCC ignores trigraphs, but if you request a strictly conforming mode with the @option{-std} @@ -346,9 +346,9 @@ Trigraph: ??( ??) ??< ??> ??= ??/ ??' ??! ??- Replacement: [ ] @{ @} # \ ^ | ~ @end smallexample -@item @cindex continued lines @cindex backslash-newline +@item Continued lines are merged into one long line. A continued line is a line which ends with a backslash, @samp{\}. The @@ -365,10 +365,10 @@ is still a continued line. However, as this is usually the result of an editing mistake, and many compilers will not accept it as a continued line, GCC will warn you about it. -@item @cindex comments @cindex line comments @cindex block comments +@item All comments are replaced with single spaces. There are two kinds of comments. @dfn{Block comments} begin with @@ -694,8 +694,8 @@ C preprocessing directive @samp{#include}. Header files serve two purposes. @itemize @bullet -@item @cindex system header files +@item System header files declare the interfaces to parts of the operating system. You include them in your program to supply the definitions and declarations you need to invoke system calls and libraries. @@ -1121,8 +1121,8 @@ Header files found in directories added to the search path with the @option{-isystem} and @option{-idirafter} command-line options are treated as system headers for the purposes of diagnostics. -@item @findex #pragma GCC system_header +@item There is also a directive, @code{@w{#pragma GCC system_header}}, which tells GCC to consider the rest of the current include file a system header, no matter where it was found. Code that comes before the |