This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Build failure on Linux - strnicmp undefined
muller@cerbere.u-strasbg.fr wrote:
>
> At 15:03 01/12/00 -0500, Fernando Nasser wrote:
> >Thanks folks. This works.
> >I will check it in momentarily.
> >
> >
> >* p-exp.y: Define strncasecmp as strnicmp for MSVC.
> > (yylex): Use strncasecmp, not strnicmp.
>
> Thanks for checking it in. I only realized this after committing it
> when I tried to compile it also on a Linux machine.
>
> However, I also found strnicmp in
> src/gdb/nlm/gdserve.c
> so I wasn't sure that I should do the change.
I think this can go.
> On the other side you can find in src/gdb/ser-e7kpc.c
>
> that strncasecmp is replaced by strnicmp by a macro for MSVC
> but several other files using strncasecmp do not have this macro
> defined. Unless this is automatically created by the configure execution,
> in which case the defines inside the c source files
> would be unnecessary.
(The #ifdef MSVC can go.)
Yes, libiberty provides the function if it determines that the host
system doesn't have it. GDB should always be using strncasecmp().
> Concerning the date of the ChangeLog entry, it was the date of the
> patch RFA on gdb-patches list. As it was only delayed for
> formatting reasons I thought that I should better not modify
> the date.
> I recieved no comment about strnicmp use when I submitted the RFA.
>
> One other strange fact is that the linux build failure was only on
> link time, is this normal ?
> Shouldn't the compiler complain about undefined function ?
> (maybe I didn't see a warning as I didn't look at the compilation progress
> on the linux box).
You'll only get a compile time warning if you configure with something
like:
--enable-gdb-build-warnings=-Werror
> I apologize deeply for the troubles I created, but
> couldn't realize before the strnicmp was not a standard
> function.
It is hard to avoid. Your testing can only go so far :-(
> Is there a way to avoid doing such errors again in the future ?
That is a more generic question, I've some thoughts but it is probably
better to start a new thread for that on gdb@sourceware.
enjoy,
Andrew