Re: [PATCH] Fix gcov handling directories with periods

2012-10-15 Thread Pedro Alves
On 10/15/2012 05:00 AM, Ian Lance Taylor wrote: > On Sat, Oct 13, 2012 at 1:11 PM, Andreas Schwab wrote: >> Ian Lance Taylor writes: >> >>> Suppose you drop this into include/libiberty.h: >>> >>> #ifdef __cplusplus >>> inline char *lbasename(char *s) { return const_cast(lbasename (s)); } >>> #end

Re: [PATCH] Fix gcov handling directories with periods

2012-10-14 Thread Ian Lance Taylor
On Sat, Oct 13, 2012 at 1:11 PM, Andreas Schwab wrote: > Ian Lance Taylor writes: > >> Suppose you drop this into include/libiberty.h: >> >> #ifdef __cplusplus >> inline char *lbasename(char *s) { return const_cast(lbasename (s)); } >> #endif > > That doesn't work: > > ../../gcc/libcpp/../include

Re: [PATCH] Fix gcov handling directories with periods

2012-10-13 Thread Andreas Schwab
Ian Lance Taylor writes: > Suppose you drop this into include/libiberty.h: > > #ifdef __cplusplus > inline char *lbasename(char *s) { return const_cast(lbasename (s)); } > #endif That doesn't work: ../../gcc/libcpp/../include/libiberty.h: In function ‘char* lbasename(char*)’: ../../gcc/libcpp/.

Re: [PATCH] Fix gcov handling directories with periods

2012-10-13 Thread Ian Lance Taylor
On Sat, Oct 13, 2012 at 11:23 AM, Andreas Schwab wrote: > Ian Lance Taylor writes: > >> Why do you need the CONST_CAST? strrchr is a standard function and it >> takes const char * as the first argument. There is other code in gcc >> that calls strrchr with a const char * argument. > > strrchr i

Re: [PATCH] Fix gcov handling directories with periods

2012-10-13 Thread Andreas Schwab
Ian Lance Taylor writes: > Why do you need the CONST_CAST? strrchr is a standard function and it > takes const char * as the first argument. There is other code in gcc > that calls strrchr with a const char * argument. strrchr is overloaded as const and non-const in C++. We need the non-const

Re: [PATCH] Fix gcov handling directories with periods

2012-10-13 Thread Ian Lance Taylor
On Sat, Oct 13, 2012 at 8:51 AM, Andreas Schwab wrote: > PR gcov-profile/44728 > * gcov.c (create_file_names): When stripping extension only look > at base name. > diff --git a/gcc/gcov.c b/gcc/gcov.c > index cf26ce1..09831c2 100644 > --- a/gcc/gcov.c > +++ b/gcc/gcov.c >

[PATCH] Fix gcov handling directories with periods

2012-10-13 Thread Andreas Schwab
PR gcov-profile/44728 * gcov.c (create_file_names): When stripping extension only look at base name. --- gcc/gcov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/gcov.c b/gcc/gcov.c index cf26ce1..09831c2 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@