delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/29/05:34:56

From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Using cgets (a !FAQ)
Date: Sat, 29 Apr 2000 10:44:19 +0200
Organization: NetVision Israel
Lines: 24
Message-ID: <390AA0E3.63EDE80A@is.elta.co.il>
References: <01bfafc6$387a7c80$da06017e AT gr-356146> <39086612 DOT 15C4E78A AT is DOT elta DOT co DOT il> <01bfb151$551a0860$da06017e AT gr-356146>
NNTP-Posting-Host: ras1-p56.rvt.netvision.net.il
Mime-Version: 1.0
X-Trace: news.netvision.net.il 956994247 200 62.0.172.58 (29 Apr 2000 07:44:07 GMT)
X-Complaints-To: abuse AT netvision DOT net DOT il
NNTP-Posting-Date: 29 Apr 2000 07:44:07 GMT
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en,ru,hebrew
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Joel Hunsberger wrote:

> Now, the interesting part is that the implicit conversion "taking place" is
> only
> reported when the compiler switch -pedantic is ON.  Without it, compilation
> was silent and apparently succesful.  However, when cgets receives a -1 as
> the
> buffer length, the stack gets corrupted... Data back from cgets is (in
> fact)
> okay (although the stack is corrupted) so the next return goes off in the
> weeds.

Welcome to C programming ;-).  The C language is traditionally permissive to
what could be dangerous practice on the part of the programmer, so it assumes
the programmer generally knows what he/she is doing.  Using -pedantic prints
lots of warnings about perfectly valid C code, that's why it is OFF by
default.

> "> Do you mean to say that it was not known to you... "
> 
> Are you really that surprised?

No, I was just trying to understand what is it that you'd like the docs to
say more explicitly.

- Raw text -


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