9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Giacomo Tesio <giacomo@tesio.it>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>,
	9front@9front.org
Subject: [9fans] 2c(2) error
Date: Tue, 10 Mar 2015 16:53:49 +0100	[thread overview]
Message-ID: <CAHL7psHuykUzuRiyPyPNLSfRm+-CobVFfrEtw+NcV75D1KNv4w@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 563 bytes --]

2c(2) states:

Array initializers can specify the indices of the array in
>   square brackets, as
>       int a[] = { [3] 1, [10] 5 };
>   which initializes the third and tenth elements of the
>   eleven-element array a.


This is somewhat confusing: the third and the tenth element should have
index 2 and 9. Moreover if the tenth element is actually referred by index
10, why the array should hold eleven elements?

A simple check shows that actually the array has 11 elements and the one
initialized are the forth and the eleventh.


Giacomo

[-- Attachment #1.2: Type: text/html, Size: 862 bytes --]

[-- Attachment #2: man.2c.diff --]
[-- Type: text/plain, Size: 371 bytes --]

diff -r 51285ae4f545 sys/man/1/2c
--- a/sys/man/1/2c	Thu Mar 05 10:17:23 2015 +0100
+++ b/sys/man/1/2c	Tue Mar 10 16:52:03 2015 +0100
@@ -250,7 +250,7 @@
 .EX
     int a[] = { [3] 1, [10] 5 };
 .EE
-which initializes the third and tenth elements of the eleven-element array
+which initializes the forth and eleventh elements of the eleven-element array
 .BR a .
 .TP
 \-

             reply	other threads:[~2015-03-10 15:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10 15:53 Giacomo Tesio [this message]
2015-03-10 16:00 ` Giacomo Tesio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHL7psHuykUzuRiyPyPNLSfRm+-CobVFfrEtw+NcV75D1KNv4w@mail.gmail.com \
    --to=giacomo@tesio.it \
    --cc=9fans@9fans.net \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).