From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"René Scharfe" <l.s.r@web.de>, "Jeff King" <peff@peff.net>,
"Elijah Newren" <newren@gmail.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH 5/5] CodingGuidelines: recommend against unportable C99 struct syntax
Date: Fri, 7 Oct 2022 11:30:34 +0200 [thread overview]
Message-ID: <patch-5.5-fc02ae52f4a-20221007T092505Z-avarab@gmail.com> (raw)
In-Reply-To: <cover-0.5-00000000000-20221007T092505Z-avarab@gmail.com>
Per 33665d98e6b (reftable: make assignments portable to AIX xlc
v12.01, 2022-03-28) forms like ".a.b = *c" can be replaced by using
".a = { .b = *c }" instead.
We'll probably allow these sooner than later, but since the workaround
is trivial let's note it among the C99 features we'd like to hold off
on for now.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
Documentation/CodingGuidelines | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines
index 893f960231f..65b608ca0a2 100644
--- a/Documentation/CodingGuidelines
+++ b/Documentation/CodingGuidelines
@@ -242,6 +242,10 @@ For C programs:
printf("%"PRIuMAX, (uintmax_t)v); These days the MSVC version we
rely on supports %z, but the C library used by MinGW does not.
+ . Shorthand like ".a.b = *c" in struct assignments is known to trip
+ up an older IBM XLC version, use ".a = { .b = *c }" instead. See
+ the 33665d98e6b portability fix from mid-2022.
+
- Variables have to be declared at the beginning of the block, before
the first statement (i.e. -Wdeclaration-after-statement).
--
2.38.0.971.ge79ff6d20e7
next prev parent reply other threads:[~2022-10-07 9:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-07 9:30 [PATCH 0/5] CodingGuidelines: various C99 updates Ævar Arnfjörð Bjarmason
2022-10-07 9:30 ` [PATCH 1/5] CodingGuidelines: update for C99 Ævar Arnfjörð Bjarmason
2022-10-07 18:08 ` Junio C Hamano
2022-10-07 9:30 ` [PATCH 2/5] CodingGuidelines: mention dynamic C99 initializer elements Ævar Arnfjörð Bjarmason
2022-10-07 9:30 ` [PATCH 3/5] CodingGuidelines: allow declaring variables in for loops Ævar Arnfjörð Bjarmason
2022-10-07 18:12 ` Junio C Hamano
2022-10-07 9:30 ` [PATCH 4/5] CodingGuidelines: mention C99 features we can't use Ævar Arnfjörð Bjarmason
2022-10-07 18:13 ` Junio C Hamano
2022-10-07 9:30 ` Ævar Arnfjörð Bjarmason [this message]
2022-10-07 17:54 ` [PATCH 0/5] CodingGuidelines: various C99 updates Junio C Hamano
2022-10-07 18:15 ` Junio C Hamano
2022-10-10 20:37 ` [PATCH v2 0/5] CodingGUidelines: " Junio C Hamano
2022-10-10 20:37 ` [PATCH v2 1/5] CodingGuidelines: update for C99 Junio C Hamano
2022-10-10 20:37 ` [PATCH v2 2/5] CodingGuidelines: mention dynamic C99 initializer elements Junio C Hamano
2022-10-10 20:37 ` [PATCH v2 3/5] CodingGuidelines: allow declaring variables in for loops Junio C Hamano
2022-10-10 20:37 ` [PATCH v2 4/5] CodingGuidelines: mention C99 features we can't use Junio C Hamano
2022-10-10 20:38 ` [PATCH v2 5/5] CodingGuidelines: recommend against unportable C99 struct syntax Junio C Hamano
2022-10-11 0:09 ` Jeff King
2022-10-11 0:26 ` Junio C Hamano
2022-10-11 0:39 ` Jeff King
2022-10-11 8:30 ` Ævar Arnfjörð Bjarmason
2022-10-11 15:01 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=patch-5.5-fc02ae52f4a-20221007T092505Z-avarab@gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=l.s.r@web.de \
--cc=newren@gmail.com \
--cc=peff@peff.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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).