From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 68BCA3858C53; Wed, 18 Jan 2023 11:03:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68BCA3858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674039787; bh=VekjvKIAlc3kzprKgF60x+m/hNq/wZmct+dqlvH2xcU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kOhDAe2Hnd+O+3w/G9B8i12tmneR+l5+DRm2UNqrwGAqCjxlx8Yb9ECrnqMc/0glV v9X0hMegK1OVtp8MPVTURU65e1l5HxgthFx2uXr5GsGA3g0JJ8uE6ZLwoFD2OuCAU/ IR4lgxmVAJ9bKU1A5SISrQMvNPQXs7JHULWxuVJk= From: "jan@swi-prolog.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/47781] warnings from custom printf format specifiers Date: Wed, 18 Jan 2023 11:03:03 +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: 4.4.5 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: jan@swi-prolog.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D47781 Jan Wielemaker changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jan@swi-prolog.org --- Comment #27 from Jan Wielemaker --- It is really a pity this can't be resolved :( We have quite a few extensio= ns in the SWI-Prolog source code, mostly for debug messages that deal with internal data structures. It makes writing debug messages a lot easier. What about this: add a pragma that associates a regular expression with a = list of types. For example (don't take this literally, I know little about the #pragma conventions). #pragma GCC printf "t" (term_t) Now if the compiler scans a template and finds a %, it runs through these declarations in the order they have been declared. On the first match it k= nows the type(s) expected from the argument list and continues after the regex match.=