Author Topic: multichar crashed in precompile judge statement  (Read 5245 times)

Offline Sugar13

  • Single posting newcomer
  • *
  • Posts: 3
multichar crashed in precompile judge statement
« on: December 09, 2013, 04:04:28 am »
when i type chinese char into the textbox, like this:
Code
#if (0xBABAD7D6 != '汉字')

the cb will crash, and show a dialog with below message:
Quote
Assertion failed!

Program: D:\ProgramC\CodeBlocks\codeblocks.exe
File: sdk\wxscintilla\src\scintilla\lexlib/CharacterSet.h
Line: 83

Expression: val >= 0

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)
what's wrong with it?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: multichar crashed in precompile judge statement
« Reply #1 on: December 09, 2013, 04:22:26 am »
when i type chinese char into the textbox, like this:
Code
#if (0xBABAD7D6 != '汉字')
Where is the text box? How can I reproduce this crash? which version of C::B?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Sugar13

  • Single posting newcomer
  • *
  • Posts: 3
Re: multichar crashed in precompile judge statement
« Reply #2 on: December 09, 2013, 04:31:46 am »
textbox is where i input the source code, cb Build: Nov 25 2012, 09:32:38 - wx2.8.12 (Windows, unicode) - 32 bit, version is Release 12.11  rev 8629

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5913
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: multichar crashed in precompile judge statement
« Reply #3 on: December 09, 2013, 04:38:44 am »
textbox is where i input the source code, cb Build: Nov 25 2012, 09:32:38 - wx2.8.12 (Windows, unicode) - 32 bit, version is Release 12.11  rev 8629

OK, your C::B version is a bit old.
I don't have this kind of error in the recent nightly build version (Nightly builds), so I suggest you can do a upgrade. Also, maybe, you can try 13.12 RC (Release 12.11, RC1 has arrived).
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Sugar13

  • Single posting newcomer
  • *
  • Posts: 3
Re: multichar crashed in precompile judge statement
« Reply #4 on: December 09, 2013, 07:39:39 am »
ok, svn build  rev 9455, this version is okey.

by the way, compiling the code makes a warning: multi-character character constant [-Wmultichar]

hao can i let the cb egnore this warning (hide this warning) ?


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: multichar crashed in precompile judge statement
« Reply #5 on: December 09, 2013, 09:51:56 am »
The compiler has told you - use "-Wno-mutltichar" if it doesn't work check the manual for your compiler.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]