ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2007/04/18/12:56:51

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Wed, 18 Apr 2007 19:20:18 +0300
From: alex bodnaru <alexbodn AT 012 DOT net DOT il>
Subject: Re: missing ANSI functions in memory.h
In-reply-to: <6fidncRj4KsWiLjbnZ2dnUVZ_vfinZ2d@comcast.com>
To: djgpp AT delorie DOT com
Message-id: <46264542.1030909@alex3>
MIME-version: 1.0
X-Enigmail-Version: 0.94.2.0
References: <mo2dnaEnpYOFn7jbnZ2dnUVZ_segnZ2d AT comcast DOT com>
<58kegmF2gqrdnU1 AT mid DOT individual DOT net>
<6fidncRj4KsWiLjbnZ2dnUVZ_vfinZ2d AT comcast DOT com>
User-Agent: Icedove 1.5.0.10 (X11/20070329)
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


hi,

gcc autodetects language.
.cc files are c++,
while .c files are usually c ones.

alex


Jim Michaels wrote:
> Martin Ambuhl wrote:
>> Jim Michaels wrote:
>>> I tried to find the proper memory.h in all the files I could, but I
>>> didn't seem to find anything.
>>
>> There is no memory.h (or <memory.h>) in C.  If you ever had one, it
>> was an implementation-specific extension.
>>
>>> malloc is defined, calloc is defined, free is defined.  but where are
>>> the other functions like memset and memcpy?
>>
>> The malloc, calloc, realloc, free family is prototyped in <stdlib.h>
>> memset and memcpy are prototyped in <string.h>
>>
>>> The documentation I saw in MSDN said it was an ANSI function.
>>
>> They are ISO (and ANSI) functions, but
>>
>>> when I #included <memory.h>
>>
>> <memory.h> is not.
>>
>>> and compiled with DJGPP's gcc, it gave me the error:
>>> In copy constructor 'var_array::var_array(const var_array&)':
>>> 124.cc(20) Error: error: 'memcpy' was not declared in this scope
>>
>> Oops! that is a C++ warning.  C++ is a different language from C, and
>> has its own newsgroup <news:comp.lang.c++>.  If your intent is to
>> write C++, go to that newsgroup.  If your intent is to write C, learn
>> to use gcc so it compiles C.
>>
>>> in MS's implementation it was defined in both memory.h and string.h
>>>
>>> I am not sure what the ANSI standard did say however.
> 
> hmm.  I am using DJGPP. this is what rhide compiles .cc files with by
> default.  I know of no way to fix this.  should it be using gxx instead?
>  I don't know the difference.
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBRiZFQtpwN1sq38njAQJopgP/b37BmMu7SfisoiVwykacscoKKOmRA99R
Xdo3WMuY1dA37T5PXIlb2Fp/XmhGGvz7I/9FHL3lmqaj0yckC5pHIcYNjCdJLoCK
0vxk0fWRRP7mjfCobVhEx63S/GIoO4uk+ObfZLEBv5tKTx5DlM+M8BB8FkJrj790
FbcqxnTqf9M=
=n9HH
-----END PGP SIGNATURE-----

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019