Skip to main content
GameDev.net gamedev.net
🔒 Locked

isctype.h in Vc.NET

Started by RobTheBloke Aug 19, 2002 at 8:55 PM 0 replies 3.2k views
Original Post
RobTheBloke
RobTheBloke
... Just got Visual C .NET and it seems to be having a fit over the isalpha, isdigit type functions. Everytime any of them are called it gives me an assert in isctype.h of this : /*** * __chvalidator * * Purpose: * This function is called by character testing functions in debug * versions. This function test for validation of c as character. * For improvement in performance, it is not used in non-debug * version. It is available in the static single-thread non-debug * build, though, just in case C code that includes ctype.h is compiled * /D_DEBUG /ML. * *******************************************************************************/ From what I gather its all about multi-byte character support. I''m actually really annoyed by this cos my scripting language parser and compiler aren''t able to run in debug anymore even though there is no actual problem with the code. Does anyone have any info (ie, how to get rid of it without changing reams of code), I''m hoping there is some sort of flag floating about somewhere which I have failed to locate yet. If not, I may be back to VC6 by tommorrow
jenova
jenova
yeah, i got this assertion as well. what i discovered was that when typecasting up from char to int it keeps the sign.

char c = 0xff;

now the line.

isctype(c); // will typecast from char to int.

the value pushed onto the stack will be 0xffffffff ensuring the signed value is kept.

edit: and if you look at the source code for the __chvalidator function it asserts that the value must be in the range 0..255.


if you are using char's then try the /J switch to treat char's as unsigned.


To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

[edited by - jenova on August 19, 2002 10:13:24 PM]
To the vast majority of mankind, nothing is more agreeable than to escape the need for mental exertion... To most people, nothing is more troublesome than the effort of thinking.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.