This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][C++] Fix dump-file corruption


Richard Guenther wrote:

> Well, do you want to re-define the langhooks semantic for 4.1? 

The langhook doesn't have defined semantics in this respect.  The
documentation in langhooks.h doesn't say anything about how long the
value is useful.  If you want to guarantee than the last N values
returned are valid, then you should also update the documentation to say
that.

> ?  Do string copies and memory frees around each such print?  I preffer
> the ringbuffer, which is really nice given we can exactly know the maximum
> number of live strings.

Are you sure that function template specializations whose template
arguments are themselves non-type arguments of function type bound to
other function templates won't overflow the ring buffer?  I would think
each of those will arguments cause a recursive call to decl_printable_name.

You don't have to do string copies in your example; just back the printf
call into multiple calls.  That's not i18n-friendly, but this is
debugging output.

-- 
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]