Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110037 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 66655 invoked from network); 6 May 2020 12:17:34 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 May 2020 12:17:34 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8C7AE1804CB for ; Wed, 6 May 2020 03:52:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 6 May 2020 03:52:40 -0700 (PDT) Received: by mail-ed1-f42.google.com with SMTP id k22so1517743eds.6 for ; Wed, 06 May 2020 03:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XqxEgEhCpt0t5vew/RS4GHXvBdLTebHydDFZ28ifC64=; b=lQaE/9tWjtd65Z/18DiOIK5Xc/40C2YoNAzoqbvSvU2UTaiUBEg7x6YNo4EtePru+s HJu7ddTWIVLQ8ytFVfRHxqruT0bgQ8BAmjAYYR05euCsu2AqiT0ZqzIxv4UHRIM7fSdK AJMOLzi0SIF8grBFoaSiL2Toe5WpG81NCDJ3hRAVOSrM5m6BzqdcFBXMr2sjKKu8gNDz FcOyUqF67Kb69Bv2AHNJO9No2z/BcwW6WgEdXcjWqiUFsP8BIp8frOwVBgkf89FMtXnm f2u4QDdNbcjpsTBvYxLyq0bxTK0KlchyjwLZ0//edI9gea3pbUP9p56wkZMGALdWurkr ogdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XqxEgEhCpt0t5vew/RS4GHXvBdLTebHydDFZ28ifC64=; b=QPlPZIK0VIqUpRnSKq4XwsrdFrXSo/eZ7LfmYn7SUzJUGwAee2YzzKVtAex0QAtY7u OXXPhWHIXBO+RCMGhoeq51V8Kh446GNd+UNkJj8IFiADo81iOgYV1WFipDlDhIEm6NDn I3l2CDCUET/slKydEu1PCLd//HQmRoflM/qtMJRvPHtiyyg1XsI3Q0DY3+Mmg8pGd91n 4AR0vImtoVq1JdfZm/SBROAte5eVgics/gPTVf3yDbh9/a751fLAL1WCi3UgHeTsF3q9 enqdCzCFGJCbuZQHC4t8bPTvVhAI1ywHMQMmXj97k1449BWBV6JdYbXOr9L2bEFU74qT ZiqA== X-Gm-Message-State: AGi0PuYGd7uO2yDnb82WsLFHsKINPZo4/S4hqyuEVk1YIbkt6yEU1+Ak +7NKBKMMEziA+kOqOVp1coWd74GkryVtJz6UCYM= X-Google-Smtp-Source: APiQypKuhIT6h1/DOdx/g2uAr5iPX2GY2yPaSh8DCY3wMisin6QQQaWh8WaAd6W5NqIoT6gi19ZTEsBOoNrotBTEhJQ= X-Received: by 2002:a05:6402:b3b:: with SMTP id bo27mr654045edb.115.1588762359103; Wed, 06 May 2020 03:52:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 6 May 2020 12:52:26 +0200 Message-ID: To: Xinchen Hui Cc: "Christoph M. Becker" , PHP internals Content-Type: multipart/alternative; boundary="0000000000000c02de05a4f89057" Subject: Re: [PHP-DEV] Update coding standards wrt. C99? From: george.banyard@gmail.com ("G. P. B.") --0000000000000c02de05a4f89057 Content-Type: text/plain; charset="UTF-8" On Wed, 6 May 2020 at 12:20, Xinchen Hui wrote: > mixing declarations and codes sometimes brings unexpected > varaibles overriden and hard to debugging. > > thanks > > -- > Xinchen Hui > @Laruence > http://www.laruence.com/ In a perfect world we would be able to enable the -Wshadow GCC compiler warning which would shout when such bugs could pop out, however variable shadowing is pretty common in the engine, and unless someone knows a way to "baseline" the current warnings such that only new/refactored code warns it seems like a long shot to get to a state where we can do that. Another related concern may be that a variable is not yet initialized, which can be flagged using -W-jump-misses-init, however due to a couple of limitations enabling it is not feasible without some small compromises, see https://github.com/php/php-src/pull/5389 Best regards George P. Banyard --0000000000000c02de05a4f89057--