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] Fix gcov handling directories with periods


On Sat, Oct 13, 2012 at 1:11 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Ian Lance Taylor <iant@google.com> writes:
>
>> Suppose you drop this into include/libiberty.h:
>>
>> #ifdef __cplusplus
>> inline char *lbasename(char *s) { return const_cast<char*>(lbasename (s)); }
>> #endif
>
> That doesn't work:
>
> ../../gcc/libcpp/../include/libiberty.h: In function ‘char* lbasename(char*)’:
> ../../gcc/libcpp/../include/libiberty.h:123:31: error: declaration of C function ‘char* lbasename(char*)’ conflicts with
> ../../gcc/libcpp/../include/libiberty.h:121:20: error: previous declaration ‘const char* lbasename(const char*)’ here

Hmmm, of course.

OK, your patch with CONST_CAST is OK.

Thanks.

Ian


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