From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id B2C0F1F403 for ; Tue, 11 Oct 2022 00:39:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229653AbiJKAjY (ORCPT ); Mon, 10 Oct 2022 20:39:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiJKAjX (ORCPT ); Mon, 10 Oct 2022 20:39:23 -0400 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 184C579EC2 for ; Mon, 10 Oct 2022 17:39:21 -0700 (PDT) Received: (qmail 29797 invoked by uid 109); 11 Oct 2022 00:39:21 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Tue, 11 Oct 2022 00:39:21 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 15633 invoked by uid 111); 11 Oct 2022 00:39:22 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Mon, 10 Oct 2022 20:39:22 -0400 Authentication-Results: peff.net; auth=none Date: Mon, 10 Oct 2022 20:39:20 -0400 From: Jeff King To: Junio C Hamano Cc: git@vger.kernel.org, =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Subject: Re: [PATCH v2 5/5] CodingGuidelines: recommend against unportable C99 struct syntax Message-ID: References: <20221010203800.2154698-1-gitster@pobox.com> <20221010203800.2154698-6-gitster@pobox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Mon, Oct 10, 2022 at 05:26:36PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > On Mon, Oct 10, 2022 at 01:38:00PM -0700, Junio C Hamano wrote: > > > >> diff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines > >> index 9598b45f7e..cbe0377699 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. > > > > FWIW, the use of the word "assignment" here left me scratching my head. > > Reading 33665d98e6b, it is about struct initialization. > > Thanks, I missed that confusion in the new description. Perhaps > another round of reroll would make the series polished enough? I read through the rest of it fairly lightly, but I didn't see have any other complaints (and the overall goal of documenting our use of compiler features is a great one). -Peff