HP3000-L Archives

January 1999, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Date:
Mon, 25 Jan 1999 16:34:09 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (34 lines)
Newman, Kevin: writes:
>
> It must exist for us GNU C folks, but it seems to be returning a
> different type than on other systems.  I receive a warning about:
> assignment makes pointer from integer without a cast.  It seems to
> exist, but like you said, it doesn't have a prototype for it.

The next release of BIND/iX that I'm still debugging defines its own strdup()
as:

char *
strdup(const char *src) {
        char *dst = malloc(strlen(src) + 1);

        if (dst)
                strcpy(dst, src);
        return (dst);
}

> So, how do I setup a prototype?  I'm definitely not a 'C' guru, not even
> a beginner really.

Pretty much the same way that you created the strdup() function:

extern char *strdup(const char *);

PS: These examples are from gcc.
--
Mark Bixby                      E-mail: [log in to unmask]
Coast Community College Dist.   Web: http://www.cccd.edu/~markb/
District Information Services   1370 Adams Ave, Costa Mesa, CA, USA 92626-5429
Technical Support               Voice: +1 714 438-4647
"You can tune a file system, but you can't tune a fish." - tunefs(1M)

ATOM RSS1 RSS2