Build bugs caused by strdup() definition

From: Bjarni R. Einarsson <bre_at_netverjar.is_at_hypermail-project.org>
Date: Thu, 11 Nov 1999 02:46:56 +0100
Message-ID: <19991111024656.A18424_at_diskordiah.localdomain>


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_at_netverjar.is           -><-           http://www.mmedia.is/~bre/

Netverjar gegn ruslpósti: http://www.netverjar.is/baratta/ruslpostur/
Received on Thu 11 Nov 1999 01:10:18 PM GMT

This archive was generated by hypermail 2.3.0 : Sat 13 Mar 2010 03:46:11 AM GMT GMT