From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 976311F619 for ; Mon, 9 Mar 2020 01:41:58 +0000 (UTC) Received: from localhost ([::1]:34872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jB7Qb-0006H6-MG for normalperson@yhbt.net; Sun, 08 Mar 2020 21:41:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48959) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jB7QW-0006Gw-ML for bug-gnulib@gnu.org; Sun, 08 Mar 2020 21:41:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jB7QV-0006vL-Iz for bug-gnulib@gnu.org; Sun, 08 Mar 2020 21:41:52 -0400 Received: from mo6-p00-ob.smtp.rzone.de ([2a01:238:20a:202:5300::4]:12035) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jB7QU-0006uH-Sr for bug-gnulib@gnu.org; Sun, 08 Mar 2020 21:41:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1583718108; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=+9Vk+weo+vgUMIQDJ1Ei8+nJTK8/P8gtip+YZgnCHuQ=; b=Vq4kH6UmHW1CZBEprKI1IMb5JCQWLdi2ngU+mLiszp3f2E7heEX5jYVo6ORwkkHFXY Rk8/EbIyyRzU/xLNYGHM/TRU+6IIjab6eFCtDgsK3zzRQdz7gZmCSj8V6an0zolnazz9 09JAcSvAjjmEfea1wYX2VoF7LZowH/lqunUwF/8OOI8WJ5lRX6d+UFy7XkrFSse88E1H X04Cmv7h1TMmjMnW4LijOP6zpO1V9VZxpyGt69tCFZChpGqFjC5IVqZEfFoL7Bb8iFzD rCvfoSnYIxkqcuTRfbybBaUGys87WHSQ8v477W+BfB1zv0SR8MlshP1jaQs1aH70DG6d Cr3w== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH+AHjwLuWOH6fzxfs=" X-RZG-CLASS-ID: mo00 Received: from bruno.haible.de by smtp.strato.de (RZmta 46.2.0 DYNA|AUTH) with ESMTPSA id e02763w290BidUa (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Mon, 9 Mar 2020 01:11:44 +0100 (CET) From: Bruno Haible To: Adrian Bunk Subject: Re: gl_{,SN}PRINTF_DIRECTIVE_N wrongly fail on Ubuntu 18.04 Date: Mon, 09 Mar 2020 01:11:43 +0100 Message-ID: <4717085.sLkeLgNmts@omega> User-Agent: KMail/5.1.3 (Linux/4.4.0-174-generic; KDE/5.18.0; x86_64; ; ) In-Reply-To: <20200308233855.GC1425@localhost> References: <20200308111935.GA20113@localhost> <11822349.64vXvSZc8K@omega> <20200308233855.GC1425@localhost> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5300::4 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bug-gnulib@gnu.org Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" Hi Adrian, > >... > > it would > > make sense for gnulib to have "nearly POSIX" compliant variants of these > > functions; this would remove the need for the gnulib *printf* code in > > many cases. > > this sounds like a good idea. Paul, Eric, what's your opinion on this? > > --- a/doc/posix-functions/fprintf.texi > > +++ b/doc/posix-functions/fprintf.texi > > @@ -30,6 +30,7 @@ NetBSD 3.0, AIX 5.1, HP-UX 11.23, IRIX 6.5, Solaris 9, > > Cygwin 1.5.x, mingw, MSVC 14. > > @item > > This function does not support the @samp{n} directive on some platforms: > > +glibc when used with @code{_FORTIFY_SOURCE >= 2} > > _FORTIFY_SOURCE > 0, the glibc code is under > if ((mode_flags & PRINTF_FORTIFY) != 0) Sorry, but I verified on 3 systems (Ubuntu, Debian, Fedora) that -D_FORTIFY_SOURCE=1 is like -D_FORTIFY_SOURCE=0, when it comes to this test program. > > (set by default on Ubuntu), > >... > > Ubuntu has enabled it by the default in gcc, which means you get it > by default not only for package building. > > Debian/Gentoo/Fedora/openSUSE (including RHEL/SLES) all add > _FORTIFY_SOURCE by default at least for building packages The documentation we write is for the users of the plain 'gcc' program (or vendor compilers). We can't consider the packaging systems of various distros, as this is not something the user sees when compiling programs as documented in the INSTALL file. If you are among the packagers for a distro, you'll need to have knowledge about the packaging systems and combine it with the knowledge you get from the gnulib documentation. Bruno