delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2006/12/02/21:45:14

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: rugxulo AT gmail DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: Re: string.h -- memccpy() prototype uses "int c, size_t n" w/o leading underscores
Date: 2 Dec 2006 18:44:06 -0800
Organization: http://groups.google.com
Lines: 23
Message-ID: <1165113846.188039.194250@j72g2000cwa.googlegroups.com>
References: <1165096766 DOT 030159 DOT 105280 AT f1g2000cwa DOT googlegroups DOT com>
<4572251A DOT 680BFA98 AT yahoo DOT com>
<200612030136 DOT kB31aPZl029891 AT envy DOT delorie DOT com>
NNTP-Posting-Host: 65.13.115.246
Mime-Version: 1.0
X-Trace: posting.google.com 1165113851 27123 127.0.0.1 (3 Dec 2006 02:44:11 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Sun, 3 Dec 2006 02:44:11 +0000 (UTC)
In-Reply-To: <200612030136.kB31aPZl029891@envy.delorie.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0,gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: j72g2000cwa.googlegroups.com; posting-host=65.13.115.246;
posting-account=qvj7NA0AAABallzf-E3FtUCXEd65I-J8
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
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

Hello,

DJ Delorie wrote:
> > Why should it?  The scope of those names is only the memccpy()
> > function.  The only thing that can foul it is a previous "#define c
> > whatever" statement, etc. or a file scope declaration of c (and I
> > assume nobody would be that stupid).
>
> That's exactly what we're trying to prevent (and yes, people are that
> stupid).

After I stumbled upon the clash (while obfuscating/shrinking the .C src
to a wimpy program of mine: went from 5k to 750 bytes or so and still
compiled), I noticed it seemed out of place to have "int c, size_t n"
when most other prototypes used underscores (e.g., "void *memchr(const
void *_s, int _c, size_t _n);"). No, not anything useful, and not even
good enough for an IOCCC entry, just me horsing around.  :-P

Feel free to keep your STRING.H unmodified if you're smart enough to
not have that problem (or work around it like I did).  :-)

P.S. "Stupid is as stupid does."  -- Forrest Gump    :-D

- Raw text -


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