ssp(3) problem?

2015-12-03 Thread Thomas Klausner
Hi!

A user tried following the ssp man page and got unexpected results.
I'd like to know if the man page is wrong or implementation.

Here's his translated message:

Take any program using stdio.h, say

#include 
#include 

as the only lines, and use gcc as described in ssp(3):

gcc -I/usr/include/ssp -D_FORTIFY_SOURCE=2 file.c

On NetBSD 6 this gives

In file included from file.c:2:0:
/usr/include/ssp/stdio.h:49:40: error: expected declaration specifiers or ‘...’ 
before ‘FILE’

On NetBSD current this gives

In file included from file.c:2:0:
/usr/include/ssp/stdio.h:49:40: error: unknown type name ‘FILE’
 char *__fgets_chk(char *, int, size_t, FILE *);

 Thomas



Re: ssp(3) problem?

2015-12-03 Thread Christos Zoulas
In article <20151126114027.gw12...@danbala.tuwien.ac.at>,
Thomas Klausner   wrote:
>Hi!
>
>A user tried following the ssp man page and got unexpected results.
>I'd like to know if the man page is wrong or implementation.
>
>Here's his translated message:
>
>Take any program using stdio.h, say
>
>#include 
>#include 
>
>as the only lines, and use gcc as described in ssp(3):
>
>gcc -I/usr/include/ssp -D_FORTIFY_SOURCE=2 file.c

The man page is wrong. Never do -I/usr/include/ssp. Definining
-D_FORTIFY_SOURCE=<0|1|2> is the only thing you need to do.

christos