-----BEGIN PGP SIGNED MESSAGE----- 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 e...@byu.net -----BEGIN PGP SIGNATURE----- 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 iEYEARECAAYFAkmWIOcACgkQ84KuGfSFAYB/AgCgu9GMMXbeCRR0aoYTiDjNOPmM 8n8AoME7H7iowzqnXWNZMRH9MThdmiT1 =+cA1 -----END PGP SIGNATURE-----