By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,654 Members | 1,842 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,654 IT Pros & Developers. It's quick & easy.

compiling using xlc in 64 bit

P: 1
Hi all,

I'm trying to compile a program using xlc in 64 bit. The program is complied and excuted correctly using 32 bit. However when I compile it in 64 bit, it fails. The problem is at malloc function. The malloc will return an address (non-zero) but when I try to dereference it, it'll core-dump.

Out of curiosity, I put #include <stdlib.h> there and suddenly it works. However, I didn't need to modify anything in order to make it work in 32-bit. Does anyone know why this is happening? Thank you very much for any advice/comment

Aug 6 '07 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 5K+
P: 9,197
malloc() is prototyped in stdlib.h.

By using the 64-bit header, you got the 64-bit prototype.

Where did your code find the 32-bit malloc()??
Aug 7 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.