Re: [Doc] Add caveat to __builtin_object_size

2012-06-04 Thread Florian Weimer
On 06/04/2012 12:11 PM, Jakub Jelinek wrote: On Mon, Jun 04, 2012 at 11:59:59AM +0200, Florian Weimer wrote: What about this? +This protection mechanism is only a last resort. As a programmer, you +must not rely on its presence, but use explicit buffer length checks +to avoid buffer overflows.

Re: [Doc] Add caveat to __builtin_object_size

2012-06-04 Thread Richard Guenther
On Mon, Jun 4, 2012 at 11:59 AM, Florian Weimer wrote: > On 06/04/2012 11:46 AM, Richard Guenther wrote: >> >> I think "accurately" is a wrong word here - doesn't that suggest it might >> get "wrong"?  The answer should always be conservatively correct, so >> it might just be not as constrained as

Re: [Doc] Add caveat to __builtin_object_size

2012-06-04 Thread Jakub Jelinek
On Mon, Jun 04, 2012 at 11:59:59AM +0200, Florian Weimer wrote: > What about this? > > +This protection mechanism is only a last resort. As a programmer, you > +must not rely on its presence, but use explicit buffer length checks > +to avoid buffer overflows. GCC may not be able to determine obj

Re: [Doc] Add caveat to __builtin_object_size

2012-06-04 Thread Florian Weimer
On 06/04/2012 11:46 AM, Richard Guenther wrote: I think "accurately" is a wrong word here - doesn't that suggest it might get "wrong"? The answer should always be conservatively correct, so it might just be not as constrained as it should. So I think you need to elaborate on "accurately" here.

Re: [Doc] Add caveat to __builtin_object_size

2012-06-04 Thread Richard Guenther
On Mon, Jun 4, 2012 at 11:09 AM, Florian Weimer wrote: > On 06/04/2012 11:01 AM, Jakub Jelinek wrote: >> >> On Mon, Jun 04, 2012 at 10:34:21AM +0200, Florian Weimer wrote: > > +This protection mechanism is only a last resort.  As a programmer, you > +must not rely on its presence, but

Re: [Doc] Add caveat to __builtin_object_size

2012-06-04 Thread Florian Weimer
On 06/04/2012 11:01 AM, Jakub Jelinek wrote: On Mon, Jun 04, 2012 at 10:34:21AM +0200, Florian Weimer wrote: +This protection mechanism is only a last resort. As a programmer, you +must not rely on its presence, but use explicit buffer length checks +to avoid buffer overflows. GCC may not be a

Re: [Doc] Add caveat to __builtin_object_size

2012-06-04 Thread Jakub Jelinek
On Mon, Jun 04, 2012 at 10:15:35AM +0200, Florian Weimer wrote: > --- gcc/doc/extend.texi (revision 187951) > +++ gcc/doc/extend.texi (working copy) > @@ -7376,8 +7376,15 @@ > @findex __builtin___vfprintf_chk > > GCC implements a limited buffer overflow protection mechanism > -that

Re: [Doc] Add caveat to __builtin_object_size

2012-06-04 Thread Jakub Jelinek
On Mon, Jun 04, 2012 at 10:34:21AM +0200, Florian Weimer wrote: > >>+This protection mechanism is only a last resort. As a programmer, you > >>+must not rely on its presence, but use explicit buffer length checks > >>+to avoid buffer overflows. GCC may not be able to determine buffer > >>+sizes a

Re: [Doc] Add caveat to __builtin_object_size

2012-06-04 Thread Florian Weimer
On 06/04/2012 10:23 AM, Jakub Jelinek wrote: On Mon, Jun 04, 2012 at 10:15:35AM +0200, Florian Weimer wrote: --- gcc/doc/extend.texi (revision 187951) +++ gcc/doc/extend.texi (working copy) @@ -7376,8 +7376,15 @@ @findex __builtin___vfprintf_chk GCC implements a limited buffer overflow prot

[Doc] Add caveat to __builtin_object_size

2012-06-04 Thread Florian Weimer
This patch adds a cross-reference to GNU libc and _FORTIFY_SOURCE (which needs to be documented there) and mentions the optimization level requirements. Okay for trunk? 2012-06-04 Florian Weimer * doc/extend.texi (Object Size Checking): Mention _FORTIFY_SOURCE, add caveat.