use of %n in genmodes.c causes trouble on Vista

Jakub Jelinek jakub@redhat.com
Thu Jun 7 10:13:00 GMT 2007


On Thu, Jun 07, 2007 at 12:09:46PM +0200, Paolo Bonzini wrote:
> 
> >printf (_("foo %s%n"), some_string, &n);
> >is ok even with -D_FORTIFY_SOURCE=2
> 
> How is this considered ok?  Is _("abc") placing the translation in 
> non-writable memory?

Yes, the *.mo file is mmaped and gettext either returns the passed
pointer if no translation is found, or a pointer into the read-only
mmaping of the *.mo file.

	Jakub



More information about the Gcc mailing list