Build bugs caused by strdup() definition

---------

From: Bjarni R. Einarsson (bre@netverjar.is)
Date: Wed Nov 10 1999 - 19:46:56 CST


Hi,

I just checked out from the CVS again, and wanted to report that the
mysterious compile error is still there for RedHat Linux 6.0.

rpm -qf $(which gcc) says I'm using egcs-1.1.2-12.

Removing the -O from the top level Makefile makes the problem go away.

I can also make the problem go away by removing the strdup definitions from
getname.c and mail.c. On my system this doesn't create any new warnings or
cause any grief at all... because strdup is defined in <string.h>, which is
included both by hypermail.h and mail.h.

The explicit strdup definitions were added after 2b25 - presumably to deal
with systems which don't define it in string.h or lack string.h entirely.
Wouldn't the "correct solution" be to have configure check for strdup and
set a variable in config.h (or the equivalent) that you can check with
an #ifdef? Explicitly redefining things should be avoided...

I'll agree that it's strange that the compiler freaks out on this, but
it's probably caused by strdup being inlined or something when optimization
is enabled (thus causing the declarations to conflict).

-- 
Bjarni R. Einarsson                           PGP: 02764305, B7A3AB89
 bre@netverjar.is           -><-           http://www.mmedia.is/~bre/
Netverjar gegn ruslpósti: http://www.netverjar.is/baratta/ruslpostur/

---------

This archive was generated by hypermail 2.1.5.