• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: incompatible implicit declaration of built-in function 'malloc'
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: incompatible implicit declaration of built-in function 'malloc'


  • Subject: Re: incompatible implicit declaration of built-in function 'malloc'
  • From: "Clark Cox" <email@hidden>
  • Date: Fri, 25 Aug 2006 16:17:16 -0400

On 8/25/06, Daniel R. Killoran,Ph.D. <email@hidden> wrote:
I get the following perplexing warning:

.../SeriatedSubs.c:159: warning: incompatible implicit declaration of
built-in function 'malloc'

on the perfectly ordinary-appearing line:

tPtr = tmpStr = (char *)malloc((size_t)leng/2+1);

In addition to the advice that you've gotten about #including <stdlib.h>, I'll add this:

When writing C code *never cast the return value of malloc*. It serves
no useful purpose, and it can serve to hide errors (Though, in this
case, GCC seems smart enough to alert you to the problem despite the
cast; not all compilers will do that for you).

--
Clark S. Cox III
email@hidden
My CV/Resume:
http://homepage.mac.com/clarkcox3/files/Resume.pdf
http://homepage.mac.com/clarkcox3/files/Resume.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >incompatible implicit declaration of built-in function 'malloc' (From: "Daniel R. Killoran,Ph.D." <email@hidden>)

  • Prev by Date: Re: incompatible implicit declaration of built-in function 'malloc'
  • Next by Date: Re: incompatible implicit declaration of built-in function 'malloc'
  • Previous by thread: Re: incompatible implicit declaration of built-in function 'malloc'
  • Next by thread: Xcode 2.4 and __isnand
  • Index(es):
    • Date
    • Thread