mirror of https://github.com/mkerrisk/man-pages
feature_test_macros.7: srcfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
fe11933096
commit
ef79705676
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue