[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: vasnprintf's "%n in writable segment" chokes with _FORTIFY_SOURCE ==
From: |
Paul Eggert |
Subject: |
Re: vasnprintf's "%n in writable segment" chokes with _FORTIFY_SOURCE == 2 |
Date: |
Thu, 18 Oct 2007 15:43:57 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Jim Meyering <address@hidden> writes:
> vasnprintf.c should resort to incurring the
> expense of that portability kludge only when necessary.
> How about if it does that only when a configure-time test
> has detected that snprintf's return value is not conforming?
That sounds like a good idea.
How common is it for snprintf to return the wrong value? If it's not
that common, perhaps we can just not worry about those systems at all.
I can't resist mentioning a more-fun workaround. We can put a
snprintf wrapper into gnulib that copies the format string into a
buffer, uses mmap to make the buffer read-only, and then calls the
real snprintf. Sort of an "anti-Fortify" wrapper, if you will.