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 C85D23858401 for ; Thu, 7 Mar 2024 12:57:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C85D23858401 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C85D23858401 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709816252; cv=none; b=V7rs/uVWkGPwNAW+lRJScVBQXiATTZkd/Z/Mvr99ubQLHtxAN9RRtXO6SHBZ8A2t/KM4vrhC0ZkQMqtCCLm84mB+Hbt1uXj0fVPYhwzWgb+LjsS61pA5mTlbtXlN1Kwp+3vF5vOufqVgLNMNguQcX6cTSvZlgh3jQK7xtfy8W1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709816252; c=relaxed/simple; bh=lpLcQU/RGHoYsdclRz1YqjI7x2nlxBxFDms02/9lcjk=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=PP0S1gnwkFI5Z4MS/QddWNdCztjDKPWSEJLKWqPuZo/i5fsath2llGVnZ2v5zJsoFnhDQWI2Ayxa91dpJyJiTqbK0fnZkGr99hnI47xz+KS73ipKuwK8uT8TtKPO79RF3Rphrtn2tIM0zn37rmFsSIXdHp98lMmrthbU21lIfD8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709816250; 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=lpLcQU/RGHoYsdclRz1YqjI7x2nlxBxFDms02/9lcjk=; b=jEtHr48S/U316e0I8q3sLotwX2edgp3zvJsc/L+5+JBL7c7VlLK+vkyJc/Doa8MFsZJYio ae3PRQACD5MfoddulcNLOw1N6jR/6tLFdegpQoPEH2sKoTJTcd5ERLMUCq5uFZYkm43VIv LbFlC+ZKp5hpc9S+k0EOZ9vEElsZ0MQ= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-158-dHOoRhihNl6YbsMoP4xW3g-1; Thu, 07 Mar 2024 07:57:26 -0500 X-MC-Unique: dHOoRhihNl6YbsMoP4xW3g-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-78819cae842so110936285a.0 for ; Thu, 07 Mar 2024 04:57:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709816246; x=1710421046; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lpLcQU/RGHoYsdclRz1YqjI7x2nlxBxFDms02/9lcjk=; b=pedmpuogWsclABowE4FzIed71PfiWOLJobNVdtlzgrPlfa0H4gzUFKh4wngfNerXv1 Heq1Q0KgEkyp6AVo/Oofxk/0sm7enalIqzc2uvV9PqQYEW6zfblBEDnUQNJv0ym0SNbJ 6XiDcdkmOB7OL0rxJJIHs4nF2Ekhu4ab0NQasF1jGSQt3at14wp/Sm8uQDbQjmJ1zLAl nMWDIu3qPw6jWg3vyt+AxxTvtGWvcI0P5/pZgXDDxBSN9tSC+S8aYCrK9siAsOYf7/t4 aQ5yuTzsW9pY/EwwOkzwfnXhspElNC9jui+IAxJ7iQrJD9Q4GnjzJL3NUMoRYdPp0ta8 RKKg== X-Gm-Message-State: AOJu0YyF9HMzPwfVZu9Y8MRvW8WC+3sjpBN63NXiLmJRHLCnkTNazXlk 68lZ6aCkHTaZjg+EYGvmtiZman87z6JINTCgvlnKtOTuzzmW7YzLIrmOcXiVm9BUDSfmpZi1O2z yxq1Mgua+AS0ON7Ts5b74Z0oRRGBFiP2LBYxtBBPxL8Rtw8+zpO9OvEk= X-Received: by 2002:a0c:b701:0:b0:690:55c6:e312 with SMTP id t1-20020a0cb701000000b0069055c6e312mr8222763qvd.39.1709816246217; Thu, 07 Mar 2024 04:57:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9ud/yWjX3vBE+NkdHFoxCsQPFnFT1UySx97d8/p6GZRXC00kMKSG2wOv0MLndDMql0u0zsg== X-Received: by 2002:a0c:b701:0:b0:690:55c6:e312 with SMTP id t1-20020a0cb701000000b0069055c6e312mr8222751qvd.39.1709816245913; Thu, 07 Mar 2024 04:57:25 -0800 (PST) Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id oj12-20020a056214440c00b006900d9ee664sm8647173qvb.33.2024.03.07.04.57.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 04:57:25 -0800 (PST) Message-ID: <0a5b5a3a888bc6070689db165ea8f1204c8bfe9a.camel@redhat.com> Subject: Re: [PATCH] analyzer: Fix up some -Wformat* warnings From: David Malcolm To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Date: Thu, 07 Mar 2024 07:57:24 -0500 In-Reply-To: References: User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 Thu, 2024-03-07 at 09:30 +0100, Jakub Jelinek wrote: > Hi! >=20 > I'm seeing warnings like > ../../gcc/analyzer/access-diagram.cc: In member function =E2=80=98void > ana::bit_size_expr::print(pretty_printer*) const=E2=80=99: > ../../gcc/analyzer/access-diagram.cc:399:26: warning: unknown > conversion type character =E2=80=98E=E2=80=99 in format [-Wformat=3D] > =C2=A0 399 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 pp_printf (p= p, _("%qE bytes"), bytes_expr); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ^~~~~~~~~~~ > when building stage2/stage3 gcc.=C2=A0 While such warnings would be > understandable when building stage1 because one could e.g. have some > older host compiler which doesn't understand some of the format > specifiers, > the above seems to be because we have in pretty-print.h > #ifdef GCC_DIAG_STYLE > #define GCC_PPDIAG_STYLE GCC_DIAG_STYLE > #else > #define GCC_PPDIAG_STYLE __gcc_diag__ > #endif > and use GCC_PPDIAG_STYLE e.g. for pp_printf, and while > diagnostic-core.h has > #ifndef GCC_DIAG_STYLE > #define GCC_DIAG_STYLE __gcc_tdiag__ > #endif > (and similarly various FE headers include their own GCC_DIAG_STYLE) > when including pretty-print.h before diagnostic-core.h we end up > with __gcc_diag__ style rather than __gcc_tdiag__ style, which I > think > is the right thing for the analyzer, because analyzer seems to use > default_tree_printer everywhere: > grep pp_format_decoder.*=3D.default_tree_printer analyzer/* | wc -l > 57 >=20 > The following patch fixes that by making sure diagnostic-core.h is > included > before pretty-print.h. >=20 > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? Yes, thanks Dave