Re: strdup Must Die!

John Brewer (jbrewer@jera.com)
Tue, 09 Mar 1999 11:13:03 -0800


At 04:36 AM 3/9/99 , Albert Fluegel wrote:
>On what f..... platform is no strdup available ?

Well, I'm using CodeWarrior on a Mac, but strdup isn't part of the ANSI C
standard libraries, so it's not guaranteed to be anywhere. It just happens
that most UNIX-like systems provide it, as does Windows. I've written my
own strdup many times, and would be happy to do so again. However,
AbiSource is trying to keep the code in the "xp" directories pure ANSI, and
in that context use of strdup is a bug.

For the record, ut_string.cpp defines a function UT_cloneString that
provides the same functionality in a cross-platform manner.

>Or must strcpy and strlen also die ?

Nope, they're in the ANSI spec.

John Brewer
Jera Design

Double-click anywhere with JarRunner! http://www.jera.com/jarrunner/



This archive was generated by hypermail 1.03b2.