[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: *** %n in writable segment detected ***

From: Eric Blake
Subject: Re: *** %n in writable segment detected ***
Date: Fri, 13 Feb 2009 18:39:51 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20081209 Thunderbird/ Mnenhy/

Hash: SHA1

According to Martin Walch on 2/13/2009 5:30 PM:
> When using rather new versions of glibc (2.8...) and gcc (4.3.3), I get an 
> ugly warning on the screen during the execution of some configure scripts 
> like 
> the ones from coreutils or m4. It says:
> *** %n in writable segment detected ***
> and this is a warning that can not be suppressed by redirecting stdout or 
> stderr as glibc opens a new tty.

This is not an autoconf bug.  Rather, it is triggered by an overeager
glibc change on a test written by gnulib.  Therefore, I'm redirecting this
to the gnulib list, in hopes that Bruno has something to add.
>   /* Copy the format string.  Some systems (glibc with _FORTIFY_SOURCE=2)
>      support %n in format strings in read-only memory but not in writable
>      memory.  */
>   strcpy (fmtstring, "%d %n");
>   if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
>       || strcmp (buf, "123 ") != 0
>       || count != 4)
>     return 1;
>   return 0;
> }
> As soon as basic optimization is turned on (-O1), the warning is thrown.
> I think it is a bad idea to get this warning from a configure script. It does 
> not appear in config.log but also can not be avoided. It confuses programmers 
> and non-programmers. Also, it should be possible to ignore any warning within 
> a configure script as it should be save to ignore any warning or error that 
> shows up during a check.

Agreed.  But again, it is not autoconf doing this, but glibc.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


reply via email to

[Prev in Thread] Current Thread [Next in Thread]