From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id EA4D93858D33 for ; Tue, 28 Feb 2023 16:07:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EA4D93858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677600462; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fJ5+5mQeYQ8eTJ+N6pjUIsSfbAXJBLsbV+NRay+7wmU=; b=LgEPZNYBGq1AGhwlGIFyt+vO2O2Hl1tEtuxz19x+Ri8WPLEeOMG2Mi3eNhCDw7WCy1QDNS DBUOGUgdqMlK+viZWHPttdaD/vgIFYfAFOadur0ZfutbQ0RBXlrLeo1jSdhTMVrp5AJU+q gVnjWP57CUeVyIzEAVkt90tFw+wc4bQ= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-142-KCr53toYPEOLWEeA8o1-eg-1; Tue, 28 Feb 2023 11:07:38 -0500 X-MC-Unique: KCr53toYPEOLWEeA8o1-eg-1 Received: by mail-qt1-f198.google.com with SMTP id b7-20020ac85407000000b003bfb9cff263so4809261qtq.6 for ; Tue, 28 Feb 2023 08:07:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fJ5+5mQeYQ8eTJ+N6pjUIsSfbAXJBLsbV+NRay+7wmU=; b=PrOMfKER0Iq8xMBGvOYp2v/z9c7j+II5HaqsAqN93bVO7T2TLUuInU9n3V386bdrpI Alcyx4axBwu54JOQkQvjnwDwh4mxHoaXWoW0dNavXIdlGkTRcvpsRRafcb48d3MI9oIz q44BlOJmGjofBaSwUtIxJmELuZvZP7rr89qKbAv4DiCOkrp1NUN/HBZEU003trsfoM0n nUSh2/JEA6EENqark0fUfEzX1eObEags1eDe1/Gve0ypBK9aTGXrFUaANplvbXhJQPdn hQFkBVVC+x+eJYp9tzSiwS60lnEzEJeJ707Vpaj9Ao4gIa+kYC0Ln0+zo/qUeoa9GA/j pPvQ== X-Gm-Message-State: AO0yUKWmBikgb/K6iFmAGdg6i0SwalxBLW63Co2+/yIBD6rTcM/+YLux mQ2NyjszZBU4dYRhV70ufbOXDNR/9ayOQkCKd7uefKEjOFTSuElRvxC+wNe/teDnZBtlK/C3a9+ UCGbErhd5G6Pja7TkBg== X-Received: by 2002:a05:6214:2509:b0:56e:b5a0:29cc with SMTP id gf9-20020a056214250900b0056eb5a029ccmr6882521qvb.32.1677600458320; Tue, 28 Feb 2023 08:07:38 -0800 (PST) X-Google-Smtp-Source: AK7set907bp55cq+tVcFqW+M7GG6rC09HpVsReDfPxb+XsPSo2QJ4YWeApDTiZQas0bofLjxoPZ7tA== X-Received: by 2002:a05:6214:2509:b0:56e:b5a0:29cc with SMTP id gf9-20020a056214250900b0056eb5a029ccmr6882463qvb.32.1677600457933; Tue, 28 Feb 2023 08:07:37 -0800 (PST) Received: from [192.168.1.108] (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id d184-20020a37b4c1000000b0073b69922cfesm6952821qkf.85.2023.02.28.08.07.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Feb 2023 08:07:37 -0800 (PST) Message-ID: <25fb8d35-bfc0-74e1-d747-28fe09019128@redhat.com> Date: Tue, 28 Feb 2023 11:07:35 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH] [vxworks] make wint_t and wchar_t the same distinct type To: Alexandre Oliva Cc: gcc-patches@gcc.gnu.org, hainque@adacore.com, joseph@codesourcery.com, nathan@acm.org References: <340c8b27-a042-43b5-4151-2341114da87a@redhat.com> From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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 2/22/23 10:23, Alexandre Oliva wrote: > Hello, Jason, > > On Feb 17, 2023, Jason Merrill wrote: > >> On 2/17/23 23:04, Alexandre Oliva wrote: >>> >>> We used to define WINT_TYPE to WCHAR_TYPE, so that both wint_t and >>> wchar_t mapped to the same underlying type, but this caused a glitch >>> in Wstringop-overflow-6.C: on vxworks, wint_t is typedef'ed to >>> wchar_t > >> And fixing that isn't an option? > > Erhm, why do you say "fixing"? That implies it's broken, but I don't > see anything in the C++ standards, or in the relevant bits that it > imports from the C standards, that rules out using wint_t = wchar_t in > C++. wint_t is imported from the C standard as an integral type that > meets certain requirements, and AFAICT in C++ wchar_t is an integral > type that meets those requirements. Am I missing something? > > > Now, could it be changed so that wint_t is wchar_t's underlying type > rather than wchar_t? If the equivalence is a compliance error, we could > file a bug report with WRS and request them to fix it, but modifying > their system headers would require a copyright license they don't grant, > so we avoid doing that. I imagine that breaking this equivalence would > have ABI implications, and even break legitimate (though unportable) > programs because of overload, specializations and whatnot, so there > would have to be very strong reasons to support a request for such a > change. > >> Do the integer builtins work properly if we force them to use wchar_t >> instead of an integer type? > > I haven't observed any regressions, I don't see any builtin functions > with wint in their signature that we even expand as builtins, and my > imagination is failing me on why an integral type such as wchar_t would > fail for wint_t, where other integral types, including wchar_t's > underlying type, would work. Did you have any specific risks in mind > about what could go wrong? Sorry, I think I was mostly confusing myself about how distinct wchar_t really is. The patch is OK. Jason