Subject: | |
From: | |
Reply To: | |
Date: | Mon, 25 Jan 1999 16:34:09 -0800 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
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)
|
|
|