From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9ADB43858D35; Tue, 16 Apr 2024 07:33:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9ADB43858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713252818; bh=m6QytFqlRFmxqpBgwTPHfeQcs4DFWlp7kxvvSrsdSfM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cha6aykqWvJf+5Z27SIgYg89P9jlGtxyXLch52S80UQayuzcdBabM4UmZ9FqkAYBE c3Y2Uetqf/eqr0MDbrchEPRnNpuHHmaxUhHCoFdfglYCL6vy3IA9fSk5Zu+dpat2MC Fjehw0YZ4eiV0sCrQX0oJu1KGGi6YjPposcmdBOk= From: "Hi-Angel at yandex dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/97100] -Wformat checks all arms of _Generic leading to irrelevant type expectation warnings Date: Tue, 16 Apr 2024 07:33:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: diagnostic, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: Hi-Angel at yandex dot ru X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97100 --- Comment #12 from Konstantin Kharlamov --- (In reply to Martin Uecker from comment #11) > A conforming C compiler has to diagnose all violations of constraints with > the same correct type of x in all branches (not the type it would have in > another context where a different is taken). As mentioned in my prev. comment, a conforming C compiler don't have to diagnose anything at all. And in fact, GCC doesn't even diagnose anything, = well not unless you explicitly pass a -Wfoo. Which doesn't make GCC any less conforming. Thus, I see no constraints to printing warnings that are useful= .=