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 7A2E638485B4 for ; Mon, 9 May 2022 10:05:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7A2E638485B4 Received: from mail-ot1-f71.google.com (mail-ot1-f71.google.com [209.85.210.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-448-g7a0hHFwPYi8WrNycIjfKg-1; Mon, 09 May 2022 06:05:02 -0400 X-MC-Unique: g7a0hHFwPYi8WrNycIjfKg-1 Received: by mail-ot1-f71.google.com with SMTP id 37-20020a9d0028000000b00605e236eb1cso6337659ota.10 for ; Mon, 09 May 2022 03:05:02 -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:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7I+e5RGB0WIgtYsqb6bUuCWc9BKQB3rn8m7qyc2bkmM=; b=G2gm3GlGs/F+yRBPNyWIfyo631GYkZbfqaC4R3v+WoJCnVKdse9K3CSzqQAah/ceeV 1gO/a7cDouZzUrKNjU+3wCuq6ftm2patvPyXOPUKWmMBLAApENo0Z7OmJoigsEJqJUYG N+TKmRT/2tDAlOAHmRw09yJZnOXLEa5ROKH68VH+ywZJjI/afWuWKbnrNnTiDyjtev6O uJ9cntHiLQ3GygvwGlJGJpwrZwTjDQ8t42je00ycAcGHXPs1zxDIv41udV54qaQ8ZsAp MI+DbJuJoLFUYpgUlQJYgCVt0cLZK0JoaTVdwv31aIpPmGjbeT1LIDnJW6RIdcadQgro 8SzA== X-Gm-Message-State: AOAM53259UE32Ru0N7zDxhGLOpgCNcyOr1uX/dvDndmKbZOp9WcKnbEo Mt6QQFuDNh/RcqaRAxlWHUBQhIvFAm5MA/emRKLpcm/DH49UqmQjDnWkMe6QwyK5oqgOFK5j+l8 bgjk59F3ceD/a3Xb0j+dOPr0= X-Received: by 2002:a4a:ad0a:0:b0:35e:79da:30c7 with SMTP id r10-20020a4aad0a000000b0035e79da30c7mr5500217oon.53.1652090701805; Mon, 09 May 2022 03:05:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4sLFk6KTYwZK0lcvL2gkvk9HcJ8kjaTFz2KLgvWO1eHM0dFXRNy/BFE/Wigbcli2k5nmRz5ZmlKgQoA8kE3Q= X-Received: by 2002:a4a:ad0a:0:b0:35e:79da:30c7 with SMTP id r10-20020a4aad0a000000b0035e79da30c7mr5500211oon.53.1652090701521; Mon, 09 May 2022 03:05:01 -0700 (PDT) MIME-Version: 1.0 References: <87wnevcb0f.fsf@oldenburg.str.redhat.com> In-Reply-To: <87wnevcb0f.fsf@oldenburg.str.redhat.com> From: Ulrich Drepper Date: Mon, 9 May 2022 12:04:50 +0200 Message-ID: Subject: Re: -Wformat and u8"" To: Florian Weimer Cc: Ulrich Drepper via Gcc X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Mon, 09 May 2022 10:05:09 -0000 On Mon, May 9, 2022 at 11:26 AM Florian Weimer wrote: > On the other hand, that cast is still quite ugly. Yes, there aren't yet any I/O functions defined for char8_t and therefore that's the best we can do right now. I have all kinds of ugly macros to high these casts. > All string-related > functions in the C library currently need it. Yes, but the cast isn't the issue. Or more correctly: gcc disregarding the cast for -Wformat is. Anyway, I'm not concerned about the non-I/O functions. This is all C++ code after all and there are functions for all the rest. > Isn't this a problem with char8_t? > Well, yes, the problem is that gcc seems to just see the u8"" type (char8_t) even though I tell it with the cast to regard it as a const char. Again, I ensure that the encoding matches and putting UTF-8 in char strings is actually incorrect (in theory).