From owner-freebsd-hackers@freebsd.org Tue May 22 09:37:26 2018 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54826EEF175 for ; Tue, 22 May 2018 09:37:26 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id E17366BD52; Tue, 22 May 2018 09:37:25 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 610A414888; Tue, 22 May 2018 09:37:19 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id w4M9bI4k005223 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 22 May 2018 09:37:18 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id w4M9bIQe005222; Tue, 22 May 2018 09:37:18 GMT (envelope-from phk) To: Ed Schouten cc: Konstantin Belousov , FreeBSD Hackers , Dimitry Andric , Thomas Munro Subject: Re: printf("%m") doesn't generate a warning -- shouldn't it? In-reply-to: From: "Poul-Henning Kamp" References: <20180521134306.GT6887@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5220.1526981837.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Tue, 22 May 2018 09:37:18 +0000 Message-ID: <5221.1526981838@critter.freebsd.dk> X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 May 2018 09:37:26 -0000 -------- In message , Ed Schouten writes: >2018-05-21 15:43 GMT+02:00 Konstantin Belousov : >> Why not add %m instead ? It is very easy and several people did it in >> round-about ways. > >Added advantage of that approach is that it allows the syslog() >function to be simplified significantly. No need to expand the %m >there, which ends up being quite messy. We have an cleanly expandable printf implementation for exactly this kind of stuff, so that is not really the case. However, expandable printf is close to useless when there is no sane/portable way to teach compilers about new formatting arguments. -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= .