From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) by sourceware.org (Postfix) with ESMTPS id AD5383861896 for ; Mon, 21 Sep 2020 22:14:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AD5383861896 Received: by mail-qk1-x744.google.com with SMTP id 16so17027160qkf.4 for ; Mon, 21 Sep 2020 15:14:08 -0700 (PDT) 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=+saMWJuQTmqcCdBssmwLmVxC0GJzVLZTyiDjI7NZXn0=; b=n41lFLvrwPhghnxw9C4hACdk8ZmG5rgtEkRYHdJzicB+1vOlCWC8YuQdxRxJzuGYHU g7HO6wrcCaaxe/8CLln6OWbvKJ6NKwg/yX7QKLvVdgjiwrjHXL1aPpvDfottndU1Z8uo 6au2zLXlPwN+xmwMhNwHcOLbWkUMDGG9b93zOD26YOGnozoSDXLRVUNa7irFOrtxkDHi 3OgGrMCv8EqvtpG9maEcJBrIhHvRLbkn+IENPWWm8ZzGsFvdEhtkBUBidFfmj/JiLRif jb/v8/H/f0VpTdw2yKJEG/Yjkoo3JNhLq1+EJo9IUGjlnWIZd3n6PyDQRppaRVd2FOI0 pO2Q== X-Gm-Message-State: AOAM530MryvhvbFpah3mrO/WVxf1uCCUTuLEGVsf7YAS+F8BPIqakP6Z tr/zI2vO2iCx8nAniCJHU0T+gEqKnpVsVRNyrZw= X-Google-Smtp-Source: ABdhPJwnTL6KhetBtWPTZVfF7PDj22JkWVaiL3h/8Mnu1xK0xg5k/GOtgMQW8evi2EwJ5Vvc6/ONmNQsZeOr5gcCvdE= X-Received: by 2002:a37:7e42:: with SMTP id z63mr2036242qkc.62.1600726448381; Mon, 21 Sep 2020 15:14:08 -0700 (PDT) MIME-Version: 1.0 References: <946e9377-0558-3adf-3eb9-38c507afe2d0@gmail.com> <874knr8qyl.fsf@oldenburg2.str.redhat.com> <875z875si2.fsf@oldenburg2.str.redhat.com> <20200921140100.GA449323@redhat.com> <20200921220443.GP6061@redhat.com> In-Reply-To: <20200921220443.GP6061@redhat.com> From: Ville Voutilainen Date: Tue, 22 Sep 2020 01:13:57 +0300 Message-ID: Subject: Re: Expose 'array_length()' macro in To: Jonathan Wakely Cc: Alejandro Colomar , Florian Weimer , gcc@gcc.gnu.org, "libstdc++" , Libc-alpha , libc-coord@lists.openwall.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2020 22:14:09 -0000 On Tue, 22 Sep 2020 at 01:07, Jonathan Wakely via Libstdc++ wrote: > ># define array_length(arr) (std:size(arr)) > > C++ programmers will not accept a macro for this. ..in other words, the C++17 version of it needs to be an inline function that returns std::size of an array, not a macro. All C++ versions need to be functions, and there should not be any #defines in any of the C++ code. Why should this be array_length and not __array_length? This is a vendor extension, so it should use a name that is reserved for such?