From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Tue, 10 Mar 2015 16:53:49 +0100 Message-ID: From: Giacomo Tesio To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>, 9front@9front.org Content-Type: multipart/mixed; boundary=001a1134573c1fb0910510f128e2 Subject: [9fans] 2c(2) error Topicbox-Message-UUID: 487fabb4-ead9-11e9-9d60-3106f5b1d025 --001a1134573c1fb0910510f128e2 Content-Type: multipart/alternative; boundary=001a1134573c1fb08c0510f128e0 --001a1134573c1fb08c0510f128e0 Content-Type: text/plain; charset=UTF-8 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 --001a1134573c1fb08c0510f128e0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
2c(2) states:

Array initiali= zers can specify the indices of the array in
=C2=A0 square brackets, as<= br>=C2=A0 =C2=A0 =C2=A0 int a[] =3D { [3] 1, [10] 5 };
=C2=A0 which init= ializes the third and tenth elements of the
=C2=A0 eleven-element array = a.

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

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


Giacomo
--001a1134573c1fb08c0510f128e0-- --001a1134573c1fb0910510f128e2 Content-Type: text/plain; charset=US-ASCII; name="man.2c.diff" Content-Disposition: attachment; filename="man.2c.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i73h8hqp0 ZGlmZiAtciA1MTI4NWFlNGY1NDUgc3lzL21hbi8xLzJjCi0tLSBhL3N5cy9tYW4vMS8yYwlUaHUg TWFyIDA1IDEwOjE3OjIzIDIwMTUgKzAxMDAKKysrIGIvc3lzL21hbi8xLzJjCVR1ZSBNYXIgMTAg MTY6NTI6MDMgMjAxNSArMDEwMApAQCAtMjUwLDcgKzI1MCw3IEBACiAuRVgKICAgICBpbnQgYVtd ID0geyBbM10gMSwgWzEwXSA1IH07CiAuRUUKLXdoaWNoIGluaXRpYWxpemVzIHRoZSB0aGlyZCBh bmQgdGVudGggZWxlbWVudHMgb2YgdGhlIGVsZXZlbi1lbGVtZW50IGFycmF5Cit3aGljaCBpbml0 aWFsaXplcyB0aGUgZm9ydGggYW5kIGVsZXZlbnRoIGVsZW1lbnRzIG9mIHRoZSBlbGV2ZW4tZWxl bWVudCBhcnJheQogLkJSIGEgLgogLlRQCiBcLQo= --001a1134573c1fb0910510f128e2--