bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: Adrian Bunk <bunk@stusta.de>
Cc: bug-gnulib@gnu.org
Subject: Re: gl_{,SN}PRINTF_DIRECTIVE_N wrongly fail on Ubuntu 18.04
Date: Mon, 09 Mar 2020 01:11:43 +0100	[thread overview]
Message-ID: <4717085.sLkeLgNmts@omega> (raw)
In-Reply-To: <20200308233855.GC1425@localhost>

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



  reply	other threads:[~2020-03-09  1:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-08 11:19 gl_{,SN}PRINTF_DIRECTIVE_N wrongly fail on Ubuntu 18.04 Adrian Bunk
2020-03-08 17:59 ` Bruno Haible
2020-03-08 18:46   ` Adrian Bunk
2020-03-08 22:04     ` Bruno Haible
2020-03-08 23:38       ` Adrian Bunk
2020-03-09  0:11         ` Bruno Haible [this message]
2020-03-09  3:36           ` Paul Eggert
2020-03-16 13:17       ` Bruno Haible

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4717085.sLkeLgNmts@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=bunk@stusta.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).