Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

memcpy in string.h

Name: Anonymous 2013-05-25 16:01

$ man memcpy
MEMCPY(3)                          Linux Programmer's Manual                         MEMCPY(3)



NAME
       memcpy - copy memory area

SYNOPSIS
       #include <string.h>


Why the fuck is memcpy in string.h? It is not exclusively for dealing with strings, shouldn't it be with malloc, exit & co. in stdlib.h?

I'm aware that this is because of the ISO specification, and that it is probably like this for historical reasons, but what are those historical reasons?

Name: Anonymous 2013-05-25 19:03

You'll have to dig up the C89 committee's minutes to be certain, the C99 Rationale document says
memcpy, memset, memcmp, and memchr were adopted in C89 from several existing implementations. The general goal was to provide equivalent capabilities for three types of byte sequences:
* null-terminated strings (str-).
* null-terminated strings with a maximum length (strn-).
* transparent data of specified length (mem-).

I imagine it is largely due to the implementations having enough similarities that they were originally lumped into the same sources, and thus the same header.

Name: L. A. Calculus !!wKyoNUUHDOmjW7I 2013-05-26 5:59

DOSE FUCKERS WANTED TO PUT strto* IN stdlib.h BAK WEN I WAS IN CHARGE OF SHIT. I TOLD DEM FUCKIN MATH BOYS TO SHOVE IT UP DER ASSES AND PISS OFF.

I WANT FUCKING strerror OUT.
I WANT FUCKING strxfrm OUT.
I WANT FUCKING strcoll OUT.

U WANNA KNO WHY DA mem* FUNCTIONS ARE IN string.h? WELL SO DO I. BACK WHEN I WAS IN DA PICTURE WE PUT DAT SHIT IN memory.h AND DAT WAS DA PROPER FUCKIN WAY TO DO IT. C89'S WHERE SHIT STARTED TO GET STUPID, I'LL TELL YA DAT FUCKIN MUCH.

>>5
WAT DA FUK IS UR PROBLEM?

>>6,13

U WANT DA MINUTES? WELL, I DON'T HAVE 'EM, BUT HERE'S DA FUCKIN' HIGHLIGHT OF 'EM:

SOMETHING-O-CLOCK NINETEEN EIGHTY FUCK: Lambda Arthur Calculus, angered after a heated argument, gets up on his desk, drops his pants to his ankles, and defecates on his copy of the current draft. Everyone else makes stupid, repulsed sounds as they hurry out of the room like little school girls. Lambda Arthur Calculus, then standing up, shouts out after them: "DATS WAT I THINK OF UR STANDARD U FUCKIN RETOIDS."

SOMETHING-O-CLOCK NINETEEN EIGHTY FUCK (minutes later): Some toilet scrubbers clean up the mess and the room is aired out. Meanwhile, in the corridor outside the room, Lambda Arthur Calculus is kicked off the committee and C begins its horrible turn for the worse.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List