public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Fix code example on representation clause
@ 2022-05-13  8:07 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-13  8:07 UTC (permalink / raw)
  To: gcc-patches; +Cc: Etienne Servais

[-- Attachment #1: Type: text/plain, Size: 220 bytes --]

The column is superfluous, component names are missing.

Tested on x86_64-pc-linux-gnu, committed on trunk

gcc/ada/

	* doc/gnat_rm/representation_clauses_and_pragmas.rst: Fix code
	snippet.
	* gnat_rm.texi: Regenerate.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 1414 bytes --]

diff --git a/gcc/ada/doc/gnat_rm/representation_clauses_and_pragmas.rst b/gcc/ada/doc/gnat_rm/representation_clauses_and_pragmas.rst
--- a/gcc/ada/doc/gnat_rm/representation_clauses_and_pragmas.rst
+++ b/gcc/ada/doc/gnat_rm/representation_clauses_and_pragmas.rst
@@ -457,14 +457,14 @@ from Ada 83 to Ada 95 or Ada 2005.  For example, consider:
 
 .. code-block:: ada
 
-     type Rec is record;
+     type Rec is record
         A : Natural;
         B : Natural;
      end record;
 
      for Rec use record
-        at 0  range 0 .. Natural'Size - 1;
-        at 0  range Natural'Size .. 2 * Natural'Size - 1;
+        A at 0 range 0 .. Natural'Size - 1;
+        B at 0 range Natural'Size .. 2 * Natural'Size - 1;
      end record;
 
 In the above code, since the typical size of ``Natural`` objects


diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -18913,14 +18913,14 @@ typically 31.  This means that code may change in behavior when moving
 from Ada 83 to Ada 95 or Ada 2005.  For example, consider:
 
 @example
-type Rec is record;
+type Rec is record
    A : Natural;
    B : Natural;
 end record;
 
 for Rec use record
-   at 0  range 0 .. Natural'Size - 1;
-   at 0  range Natural'Size .. 2 * Natural'Size - 1;
+   A at 0 range 0 .. Natural'Size - 1;
+   B at 0 range Natural'Size .. 2 * Natural'Size - 1;
 end record;
 @end example
 



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-13  8:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13  8:07 [Ada] Fix code example on representation clause Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).