X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Received: by 10.224.129.196 with SMTP id p4mr29088390qas.6.1372148700095; Tue, 25 Jun 2013 01:25:00 -0700 (PDT) X-Received: by 10.50.131.135 with SMTP id om7mr716787igb.7.1372148700061; Tue, 25 Jun 2013 01:25:00 -0700 (PDT) Newsgroups: comp.os.msdos.djgpp Date: Tue, 25 Jun 2013 01:24:59 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse AT google DOT com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.222.72.40; posting-account=jrLHRgkAAABPV01ZW_RN_U6Tm5UnYNUx NNTP-Posting-Host: 71.222.72.40 References: <36e857f0-9899-496b-9fc6-32251e109888 AT googlegroups DOT com> <858cbded-7989-46e6-a997-93f842cdb3b0 AT googlegroups DOT com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <020e0244-406c-4c1f-9dbc-d82a0fae976f@googlegroups.com> Subject: Re: General Protection Fault error is intermittent From: "K.J.Williams" Injection-Date: Tue, 25 Jun 2013 08:25:00 +0000 Content-Type: text/plain; charset=ISO-8859-1 Bytes: 3142 Lines: 52 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 Precedence: bulk On Sunday, June 23, 2013 8:54:27 AM UTC-7, Martin Str|mberg wrote: > K.J.Williams wrote: > > > Yeah I am not checking for a null pointer in the second use > > > of strtok() in my string_parser() to prevent me from copying > > > the string back to the calling statement. Thats not why > > > I posted my message here. You see, I wrote the program parstext.c > > > to test my function for the larger program that I want to implement > > > it for. But the problem is that DJGPP will not warn me about violating > > > memory boundaries with the parstext.c program as it does with the > > > bigger program WATT ( a project of several files ). I wanted to know > > > why isn't DJGPP warning me when I run parstext.c runs without complaints? > > > Its basically a segmented memory violation caused by strtok on following > > > calls. > > > > It's WINDOWS's fault. It's DPMI host doesn't provide the functionality > > that this requires. Try booting in plain DOS and run with CWSDPMI and > > you should get a crash if you're using NULL pointers. > > OK, Thanks. BTW, I found another bug with DJGPP if you have program that just uses : #include #include ...and you use a function from ctype.h - as I did with isspace(), without including ctype.h in your includes ... DJGPP/GCC will NOT complain about it and will still compile it. I just discovered it and made the correction to add #include to save myself from future headaches. ...Secondly, I found this strange, but some how the ANSI C or C++ standard doesn't consider the escape sequence '\b' (for backspace) as a white-space character when I use isspace() to check individual characters in a c-string. I just wanted to mention these two observations... KJW