From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,cc5580f784f75ab1 X-Google-Attributes: gidfee84,public From: danpop@afsmail.cern.ch (Dan Pop) Subject: Re: malloc() in /usr/include files Date: 1995/04/19 Message-ID: #1/1 X-Deja-AN: 101270940 sender: news@news.cern.ch (USENET News System) x-nntp-posting-host: ues5.cern.ch references: organization: CERN European Lab for Particle Physics newsgroups: comp.unix.osf.osf1 In Jon Howell writes: >Okay, I'm a little perplexed. First, background: > > OSF 3.0, gcc/g++ 2.6.3, libg++ 2.6.2. > >Now I'm trying to build some C++ code with g++. I have two files which >require malloc and friends; when I #include in them, Wrong header. Use #include instead, as required by ANSI C. >My questions: > 1. Why doesn't OSF/1 prototype malloc() and friends? I did a find -exec > grep, and nothing under /usr/include appeared to prototype malloc(). Try "grep malloc /usr/include/stdlib.h". It works on my OSF/1 2.1 box. > 2. How do I find out more about C++ symbol-munging? I'd like to know > the hows and whys, and how I can say in a prototype that this is a > boring old C function, so don't munge the symbol name. > The common practice is something like this: extern "C" { /* put here all the prototypes for the "boring old C functions" */ } Dan -- Dan Pop CERN, CN Division Email: danpop@afsmail.cern.ch Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland