feature_test_macros.7: srcfix

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2015-02-23 14:46:25 +01:00
parent fe11933096
commit ef79705676
1 changed files with 12 additions and 0 deletions

View File

@ -479,6 +479,18 @@ With
.B _FORTIFY_SOURCE
set to 2 some more checking is added, but
some conforming programs might fail.
.\" For example, given the following code
.\" int d;
.\" char buf[1000], buf[1000];
.\" strcpy(fmt, "Hello world\n%n");
.\" snprintf(buf, sizeof(buf), fmt, &d);
.\"
.\" Compiling with "gcc -D_FORTIFY_SOURCE=2 -O1" and then running will
.\" cause the following diagnostic at runtime at the snprintf() call
.\"
.\" *** %n in writable segment detected ***
.\" Aborted (core dumped)
.\"
Some of the checks can be performed at compile time,
and result in compiler warnings;
other checks take place at run time,