From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by sourceware.org (Postfix) with ESMTPS id BD8E0385828B for ; Wed, 8 Jun 2022 15:02:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD8E0385828B Received: by mail-yb1-xb2c.google.com with SMTP id r3so2797800ybr.6 for ; Wed, 08 Jun 2022 08:02:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=dd2PuWrO0JAquzsC69gto4PqdVGwk+MV4eo/vdS5bTA=; b=RQPXnXD/zXFJR0BsFebeOVBhedO16UPeVFz8hCUNDFRIPru/OG7dP2+bVU/6WaZ9J7 lURTewyQ23rlznGZAi0DFp0cDF+Gd1qdekbBY3v0LK/R1MutocShe0tOqV3hkaj9xqxu Qteq7iEoZAyq4A6mr8m+qxAbMCl20Y0Or1mEUuHj+R5XVE8mvJMm7VqkvxAD0UsvEKtK 9rNFRDevSnfdADALvuORRJxU+elPPm6A+YFwExCb4fHyFcXtxJ9Gh101CymvfS0ZaIgV k67tcZQ4t7DjJMA0z87g1b0ZCwxQHGbSCotoPu8OZ9AUtsY8sjFYRtuCDHLRkNso3sFl xCDQ== X-Gm-Message-State: AOAM533YqEtwXo2I4FBj1ybF9XW8nwys7tvudVssCMnaYX0H1oK+OXvz YJgsR8WNhT7fHlUkEtcd0wgNLtOQeT26msQPu869r4VULNY= X-Google-Smtp-Source: ABdhPJwj5dJaezSCMhGVduKyQ8+Hp5VdlXbUg4CS8QiiR4z4Vxtl7zenHiaguO1bQ+F/fMFuN8UbBvXUcHVbge+oJsI= X-Received: by 2002:a25:8584:0:b0:664:13fd:4ee1 with SMTP id x4-20020a258584000000b0066413fd4ee1mr2136888ybk.59.1654700562577; Wed, 08 Jun 2022 08:02:42 -0700 (PDT) MIME-Version: 1.0 From: Yair Lenga Date: Wed, 8 Jun 2022 11:02:31 -0400 Message-ID: Subject: [RFC] Support for nonzero attribute (Miika) To: gcc@gcc.gnu.org X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2022 15:02:45 -0000 Miika - lot of thanks. In .y mind, this is a major improvement. Also, want to suggest taking a nother look into the semnatic. I agreed inrange should include the low and high, similar to the gcc extensions) .. operator, the SQL in operator, perl .. operator, etc. There is another use common use case: creating a variable that can be used to index an array. With the inrange: Double a[MAX_ELEM]; Int ia __attr__((inrange(0, (sizeof(a)/sizeof(a[0]))) ; One trivial solution will be to define a macro #define array_index(a) int __attr__((inrange(0, (sizeof(a)/sizeof(a[0]))) And then we can do: Array_index(a) ia; which I think is very cool. Yair