[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] inttostr.h: add compile-time buffer overrun checks
From: |
Paul Eggert |
Subject: |
Re: [PATCH] inttostr.h: add compile-time buffer overrun checks |
Date: |
Mon, 25 Oct 2010 11:35:08 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.14) Gecko/20101006 Thunderbird/3.0.9 |
On 10/25/10 11:00, Paolo Bonzini wrote:
> I can take a look at the code, it is definitely safe with GCC 4 and
> -fno-tree-ter.
Thanks. The idea would be that, if we can check at configure-time
or compile-time whether it's safe, then we could fall back on
alloca rather than malloc.
While we're looking into GCC, what I'd like is the ability to say
something like this:
(char [100]) { ? }
meaning, I want a 100-byte buffer that is uninitialized. Here, the
"?" is an extension to the initializer syntax which means that the
object has an unspecified value, much as "char x[100];" declares
a local variable X with an unspecified value. I don't care what
syntax to use, so if it's better to use a new __builtin_unspecified
gizmo than to use ?, that's fine.
The advantage of this is that GCC would no longer have to initialize
the buffer to zero. This initialization is entirely a waste of time
in the proposed inttostr change.
Would it be reasonable to propose something like this for GCC?
- Re: [PATCH] inttostr.h: add compile-time buffer overrun checks, (continued)
- Re: [PATCH] inttostr.h: add compile-time buffer overrun checks, Bruno Haible, 2010/10/18
- Re: [PATCH] inttostr.h: add compile-time buffer overrun checks, Paul Eggert, 2010/10/19
- Re: [PATCH] inttostr.h: add compile-time buffer overrun checks, Jim Meyering, 2010/10/19
- Re: [PATCH] inttostr.h: add compile-time buffer overrun checks, Paul Eggert, 2010/10/24
- Re: [PATCH] inttostr.h: add compile-time buffer overrun checks, Jim Meyering, 2010/10/25
- Re: [PATCH] inttostr.h: add compile-time buffer overrun checks, Bruno Haible, 2010/10/25
- Re: GCC and __builtin_object_size, Bruno Haible, 2010/10/25
- Re: [PATCH] inttostr.h: add compile-time buffer overrun checks, Paolo Bonzini, 2010/10/25
- Re: [PATCH] inttostr.h: add compile-time buffer overrun checks, Paul Eggert, 2010/10/25
- Re: [PATCH] inttostr.h: add compile-time buffer overrun checks, Paolo Bonzini, 2010/10/25
- Re: [PATCH] inttostr.h: add compile-time buffer overrun checks,
Paul Eggert <=
- Re: alloc_size attribute, Bruno Haible, 2010/10/17
- Re: alloc_size attribute, Jim Meyering, 2010/10/17
- Re: alloc_size attribute, Bruno Haible, 2010/10/17
- Re: alloc_size attribute, Jim Meyering, 2010/10/17