X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Rod Pemberton" Newsgroups: comp.os.msdos.djgpp Subject: Re: General Protection Fault error is intermittent Date: Wed, 26 Jun 2013 03:45:55 -0400 Organization: Aioe.org NNTP Server Lines: 57 Message-ID: References: <36e857f0-9899-496b-9fc6-32251e109888 AT googlegroups DOT com> <858cbded-7989-46e6-a997-93f842cdb3b0 AT googlegroups DOT com> <020e0244-406c-4c1f-9dbc-d82a0fae976f AT googlegroups DOT com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org X-Complaints-To: abuse AT aioe DOT org X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.2001 X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Microsoft Outlook Express 6.00.2800.2001 X-Priority: 3 X-MSMail-Priority: Normal Bytes: 2720 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com "K.J.Williams" wrote in message news:020e0244-406c-4c1f-9dbc-d82a0fae976f AT googlegroups DOT com... > On Sunday, June 23, 2013 8:54:27 AM UTC-7, Martin Str|mberg wrote: > > K.J.Williams wrote: ... > 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 It "complains" here. However, you have to specify the '-Wall' parameter to gcc to get it to "complain" in the first place. Did I mention that previously? You might consider using '-Wall -pedantic' at a minimum. You can use '-ansi' for C89/C90 code. It sounds to me like you might be using the wrong function. When you want to detect non-printable characters, you probably want to use isgraph() instead of isspace() etc. Specifically, you probably want the logical opposite of isgraph(). I.e., if(!isgraph(c)) { .... } Or, you could use a small switch() statement to detect your own set of characters. You can also use isgraph() with isalnum() to create an ispunct() etc. Some systems return strange results for some of the isXXX() set of functions, i.e., better to create your own from the "safe" functions where everything is defined. > ...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. Well, that's part of the standard. Rod Pemberton