Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: danpop@afsmail.cern.ch (Dan Pop)
Subject: Re: malloc() in /usr/include files
Date: 1995/04/19	[thread overview]
Message-ID: <danpop.798326399@rscernix> (raw)
In-Reply-To: Pine.OSF.3.91.950419104826.8485M-100000@stout.hitl.washington.edu

In <Pine.OSF.3.91.950419104826.8485M-100000@stout.hitl.washington.edu> Jon Howell <jonh@hitl.washington.edu> 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 </usr/include/malloc.h> in them,

Wrong header.  Use #include <stdlib.h> 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



  reply	other threads:[~1995-04-19  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-04-19  4:00 malloc() in /usr/include files Jon Howell
1995-04-19  4:00 ` Dan Pop [this message]
1995-04-19  4:00 ` Daniel S. Riley
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox