From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id 4FB3F3858D1E; Mon, 19 Jun 2023 18:48:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4FB3F3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-518ff822360so4708139a12.1; Mon, 19 Jun 2023 11:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687200511; x=1689792511; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=T4hsDYbOfFUyugNgPQW6iDa0LyXqAF9q5uW7DPNHGs4=; b=ZViHwnkTOnyqORFCo9E01sJfqZxe3ausZz+kpO9VXPpPOx6HAqayx78BJhVkYy5+Ne Ji+Fi4pW2CRmNSZUp8ei/0STHNN39eoPdIPOfIltNc9pgJl4iMUn45SK48jU8OTvMXkT HVdsUlytIlaBmlPN5uWxegCLLU98VQArfE7a8IPC/UAoppfzQjWi0zEcjdvAg8lDx3fB 1/9Emt4nkV3Mvg5bh3+r0ly8ArFZlq8JCcyTZso0c6S5M2tuPh+DA1ZKds1ugl769KgR 2Hl2LhCFQl4D+B3CTYIlHhb0aT/7ms1uVFN5Jf770VmDPSDB0J13o9iErX0rwPM/TjnP d5Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687200511; x=1689792511; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T4hsDYbOfFUyugNgPQW6iDa0LyXqAF9q5uW7DPNHGs4=; b=PtgZWVS58AW/q9cETmDRCskeD8kfonwGVQ+uFI96g4ZfgjxnuwprUujv2/XX7VOx9S 2tyTRs4yk1+zNFXsg71+UNQkCG+n5ZUdPMkggTvLCT2qmE1sqw0onlUYb/ma8h1hyNZj n5NATrDzNoj+NbHQB1dX75eFK+I3HGCPZWm/5sK0AziW2Qy5z3/QbNCZjoDsZd09kitM 8nJDr6fv480kyfDCOiJ8ROUgsAo2BYY3IsvBCemQuglSt0KTUKBHVYfEqUA4+HdoMEEL opcPED9nsXsLYhyvo8EDZ1KOq4go7bPutiIjoUeyNKoW4MH3QYplSVYvC5Rf+bq9/i/I BF9w== X-Gm-Message-State: AC+VfDw2A0XgLDgXRMSBxLEfHX52mGPMei863OHZ6MldU/DeuWV5+AdP 6a7vYZdUwrjtI2fj9p0FN+I0jvpMEcs= X-Google-Smtp-Source: ACHHUZ6Hdcss7hDpIVcD8QV/Dtlho5eI3ucpQhZkgs2BWGMlCEStF2DHNeH+g1qADvJUijckYiqGuA== X-Received: by 2002:a17:906:6a1e:b0:989:15b1:9989 with SMTP id qw30-20020a1709066a1e00b0098915b19989mr132674ejc.68.1687200510445; Mon, 19 Jun 2023 11:48:30 -0700 (PDT) Received: from ?IPv6:::1? ([2001:4bb8:101:aa73::d19:18df]) by smtp.gmail.com with ESMTPSA id y4-20020a1709060a8400b00988168ed20asm50497ejf.185.2023.06.19.11.48.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Jun 2023 11:48:29 -0700 (PDT) Date: Mon, 19 Jun 2023 20:48:24 +0200 From: Bernhard Reutner-Fischer To: Alexandre Oliva , Alexandre Oliva via Gcc-patches , gcc-patches@gcc.gnu.org CC: Joseph Myers , fortran@gcc.gnu.org Subject: Re: [PATCH] Introduce hardbool attribute for C In-Reply-To: References: Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.0 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,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 List-Id: On 16 June 2023 07:35:27 CEST, Alexandre Oliva via Gcc-patches wrote: index 0000000000000=2E=2E634feaed4deef --- /dev/null +++ b/gcc/testsuite/gcc=2Edg/hardbool-err=2Ec @@ -0,0 +1,28 @@ +/* { dg-do compile } */ +/* { dg-options "" } */ + +typedef _Bool __attribute__ ((__hardbool__)) +hbbl; /* { dg-error "integral types" } */ + +typedef double __attribute__ ((__hardbool__)) +hbdbl; /* { dg-error "integral types" } */ + +enum x; +typedef enum x __attribute__ ((__hardbool__)) +hbenum; /* { dg-error "integral types" } */ + +struct s; +typedef struct s __attribute__ ((__hardbool__)) +hbstruct; /* { dg-error "integral types" } */ + +typedef int __attribute__ ((__hardbool__ (0, 0))) +hb00; /* { dg-error "different values" } */ + +typedef int __attribute__ ((__hardbool__ (4, 16))) hb4x; +struct s { + hb4x m:2; +}; /* { dg-error "is a GCC extension|different values" } */ +/* { dg-warning "changes value" "warning" { target *-*-* } =2E-1 } */ + +hb4x __attribute__ ((vector_size (4 * sizeof (hb4x)))) +vvar; /* { dg-error "invalid vector type" } */ Arm-chair, tinfoil hat still on, didn't look closely, hence: I don't see explicit tests with _Complex nor __complex__=2E Would we want = to check these here, or are they handled thought the "underlying" tests abo= ve? I'd welcome a fortran interop note in the docs as hinted previously to cov= er out of the box behavior=2E It's probably reasonably unlikely but better = be safe than sorry? cheers,