bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mingw and memcmp


From: Bruno Haible
Subject: Re: mingw and memcmp
Date: Fri, 21 Dec 2007 15:12:01 +0100
User-agent: KMail/1.9.1

Hi Eric,

> +2007-12-20  Eric Blake  <address@hidden>
> +
> +       Work around circular library issue when cross-compiling.
> +       * lib/progname.c (set_program_name): Use strncmp, not memcmp, so
> +       that progname.o does not need to pull in rpl_memcmp.

I don't like this patch at all.

1) Understanding code which uses memcmp takes 2 brain cycles, code which uses
   strncmp takes 5 brain cycles. strncmp is so easy to abuse.

2) There was absolutely nothing wrong with lib/progname.c.

What _is_ the problem?
  - You chose to use the module 'memcmp'.
    Your config.h therefore contains a "#define memcmp rpl_memcmp".
  - modules/progname omitted the dependency to memcmp.
  - libtests.a did not include memcmp.o.

Accordingly, there are three possible fixes to choose from:

  - You can bury the 'memcmp' module. It's not needed by ANSI C systems,
    and gnulib assumes ANSI C for ca. 2 years already.

  - You can add the dependency progname -> memcmp. This forces everyone else
    to use --avoid=memcmp.

  - You can change gnulib-tool to emit link dependencies
       libtests.a ../lib/libm4.a libtests.a ../lib/libm4.a libtests.a
    instead of just
       libtests.a ../lib/libm4.a libtests.a

Please consider.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]