Article View: gnu.gcc.help
Article #50800Problem with header files on GCC as C++ compiler
From: Jon Robinson;BOREAS;6-4545
Date: Thu, 26 Aug 1993 19:10
Date: Thu, 26 Aug 1993 19:10
49 lines
2149 bytes
2149 bytes
I've tried compiling a code fragment with the gcc
compiler and get message that my call to
malloc has too many arguments. It looks like
...
if ( ! ( parameterName = (char *) malloc( paramNameLength ) ) )
{
/* send error message to panel handler
not enough memory for parameter Name */
/* abort constructor */
}
strcpy( parameterName, parameterN ) ;
typeparam = typepar ;
}...
I have tried specifying a number of header files
that contain the prototype ... such as:
#include <malloc.h>
gcc -c mparam.C
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.4.5/include/malloc.h: In method `par
ameter::parameter (char *, enum paramtype)':
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.4.5/include/malloc.h:41: too many ar
guments to function `void * malloc ()'
mparam.C:25: at this point in file
It seems that they have malloc defined with
no arguments.
or
#include <stdlib.h>
gcc -c mparam.C
In file included from mparam.C:12:
/usr/local/lib/g++-include/stdlib.h:38: parse error before `('
/usr/local/lib/g++-include/stdlib.h:38: parse error before `*'
/usr/local/lib/g++-include/stdlib.h:38: warning: data definition has no type or
storage class
there is an error in the supplied header file.
Any suggestions??
-Jon
Technical Details
Message-ID:
<25j1qn$op5@skates.gsfc.nasa.gov>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!usenet.ins.cwru.edu!agate!ames!skates.gsfc.nasa.gov!ltpsun!robinsonShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,ec6fcdeb2764d0f2,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1993-08-26 12:50:02 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!usenet.ins.cwru.edu!agate!ames!skates.gsfc.nasa.gov!ltpsun!robinson From: robinson@ltpsun.gsfc.nasa.gov (Jon Robinson;BOREAS;6-4545) Newsgroups: gnu.gcc.help Subject: Problem with header files on GCC as C++ compiler Date: 26 Aug 1993 19:10:14 GMT Organization: NASA Goddard Space Flight Center Lines: 49 Distribution: world Message-ID: <25j1qn$op5@skates.gsfc.nasa.gov> Reply-To: robinson@ltpsun.gsfc.nasa.gov NNTP-Posting-Host: ltpsun.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Keywords: GCC, Header Files, Conflicting header definitions