🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #580

Re: memcpy(), memcmp() in cplus-dem.c

#580
From: Tom Vijlbrief
Date: Tue, 14 Nov 1989 07:46
23 lines
1392 bytes
jonathan@comp.vuw.ac.nz writes:

>ld++ will not build on some 4.2-based Unix systems, because
>cplus-dem.c assumes it is either running on a sequent, or a System V
>machine (which, these days, includes Suns) that has memcpy() and
>/usr/include/memory.h.  The following change seems more portable, and
>more in the spirit of other GNU code:

>  #define memcpy(s1, s2, n) strncpy(s1, s2, n) 

According to the manual page on my Sun strncpy will "null-pad" s2
when it finds a zero byte before the n bytes are copied.

So memcpy and strncpy will often be not compatible.

Tom
===============================================================================
Tom Vijlbrief
TNO Institute for Perception
P.O. Box 23				Phone: +31 34 63 562 11
3769 ZG  Soesterberg			E-mail: tnosoes!tom@mcvax.cwi.nl
The Netherlands				    or:	uunet!mcvax!tnosoes!tom
===============================================================================
Technical Details
Message-ID: <500@tnosoes.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!njin!princeton!udel!wuarchive!wugate!uunet!mcsun!hp4nl!tnosoes!tom
References: <8911131003.AA01009@comp.vuw.ac.nz>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!njin!princeton!udel!wuarchive!wugate!uunet!mcsun!hp4nl!tnosoes!tom
From: tom@tnosoes.UUCP (Tom Vijlbrief)
Newsgroups: gnu.g++.bug
Subject: Re: memcpy(), memcmp() in cplus-dem.c
Message-ID: <500@tnosoes.UUCP>
Date: 14 Nov 89 07:46:36 GMT
References: <8911131003.AA01009@comp.vuw.ac.nz>
Distribution: gnu
Organization: TNO Institute for Perception, Soesterberg, The Netherlands
Lines: 23