Hi Eric,

> +2007-12-20  Eric Blake  <[EMAIL PROTECTED]>
> +
> +       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