From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by sourceware.org (Postfix) with ESMTPS id 99F3C3858015 for ; Tue, 25 Jan 2022 04:08:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 99F3C3858015 Received: by mail-qt1-x82c.google.com with SMTP id i4so7725125qtr.0 for ; Mon, 24 Jan 2022 20:08:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=/AGsb9l8fuG1TQdhP5T1d0G+vuoUbFY7uW3lGcrQbpo=; b=lNewSPnZpOlkIQvoO6fm32dD9geBp3nwBQoeW2jnpKV/1dl8ViT/mbcBj0VWWA3GUt iLZGkxgVunihTr2Ca6V/nxnAvOtfH48VMUJoO+5biSkuXW/6UDHTR1DJeJMBUceHuxuK I01udZNonMXti/5nzKNySevM4XL9JP9WuiaYSnF0BZQytiogBSR1WOk3dFYYDOWfqN/P mXOXbxwM7YR+S+LtHtwhA9UvjzD8KGsx6ECgy96+JGf0xV2jMaiaAQ3+5U3xQF1mi0/+ HhvItkE/F0TpxKDft6D6/ggS/RL+K8vH1UqLdlpM6D1gu3ajbgmu77RXRx0ayUgHlghW IzGw== X-Gm-Message-State: AOAM532gZ7KmD1ZsHqeqoqJkeTFN/Bs4Tk96TMULlApB3A+QEDqKNO34 vl3qGCf6iRiVPBakFaYd1qKbzxjq90Hb/sujq0oxGieFYJL0ug== X-Google-Smtp-Source: ABdhPJwOWUrYc0is0+MR1W4PX/4BeJYMUBsJvRetYYfAM+cRMNzJVm7gZ/YD46+Nwuc0Rxnzk7Q+vGoTystnQCe/ToM= X-Received: by 2002:a05:622a:1911:: with SMTP id w17mr6860167qtc.659.1643083706125; Mon, 24 Jan 2022 20:08:26 -0800 (PST) MIME-Version: 1.0 From: Kris Andersen Date: Mon, 24 Jan 2022 23:08:15 -0500 Message-ID: Subject: =?UTF-8?Q?syslog=3A_ISO_C_does_not_support_the_=E2=80=98=25m=E2=80=99_gnu=5Fprin?= =?UTF-8?Q?tf_format?= To: gcc@gcc.gnu.org X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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" Content-Transfer-Encoding: quoted-printable 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: Tue, 25 Jan 2022 04:08:29 -0000 The %m format specifier is a documented feature of syslog, but gcc gives a warning when -Wpedantic is used. Is this a bug? For example, the program: #include int main(void) { syslog(LOG_ERR, "%m"); return 0; } gives: warning: ISO C does not support the =E2=80=98%m=E2=80=99 gnu_printf format = [-Wformat=3D] when compiled[1] with gcc -Wall -Wextra -Wpedantic -o test test.c The man page for syslog(3) states that %m is supported: "the two-character sequence %m will be replaced by the error message string strerror(errno)." Submitting a bug report for this feels like arguing that the answer in the back of the book is wrong (...rarely the right move). What am I missing here? Thanks in advance, Kris [1]: gcc (GCC) 11.2.1 20211203 on Linux version 5.15.16-200.fc35.x86_64 (Fedora v35)