Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / January 2005



Tip: Looking for answers? Try searching our database.

alloca link error with BSD

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Allen Cronce - 22 Jan 2005 16:18 GMT
Hi all,

I'm building third party sources under Panther in a Mach-O BSD target.
I'm not using MSL. I'm seeing a link error where 'alloca' cannot be
found.

I understand that usually alloca is an intrinsic function, so I'm
including alloca.h. But in usr/include/alloca.h the function doesn't
seem to be built-in unless the compiler is gcc.

Any suggestions as to how I can get alloca to work with CodeWarrior and
BSD?

Best regards,
--
Allen Cronce
Allen Cronce - 22 Jan 2005 16:51 GMT
I think I solved this, but it's kind of a hack. Basically in my prefix
file I added the following for the Mach-O build:

#define _ALLOCA_H_
#undef    alloca
#define    alloca(size)    __alloca(size)

That prevents the GCC alloca.h from being loaded and it forces the
define of alloca to the intrinsic function name used by CodeWarror.
If there's a better way, I'm all ears...

Best regards,
--
Allen Cronce
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.