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 sch...@linux-m68k.org wrote: Ian Lance Taylor i...@google.com writes: Suppose you drop this into include/libiberty.h: #ifdef __cplusplus inline char *lbasename(char *s) { return

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 sch...@linux-m68k.org wrote: Ian Lance Taylor i...@google.com writes: Suppose you drop this into include/libiberty.h: #ifdef __cplusplus inline char *lbasename(char *s) { return const_castchar*(lbasename (s)); } #endif That doesn't work:

[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

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 sch...@linux-m68k.org 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 +++

Re: [PATCH] Fix gcov handling directories with periods

2012-10-13 Thread Andreas Schwab
Ian Lance Taylor i...@google.com 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

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 sch...@linux-m68k.org wrote: Ian Lance Taylor i...@google.com 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

Re: [PATCH] Fix gcov handling directories with periods

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