Discussion:
isascii and standards compliance
Neil Hodgson
2013-07-21 11:30:12 UTC
Permalink
The isascii function was used extensively in Scintilla lexers to ensure that character values were safe for calls to other functions such as isalpha or isdigit which could access out-of-bounds memory if called with non-ASCII values leading to failures or inconsistent behaviour. Unfortunately isascii is not part of ISO C++ (or C) but is actually a BSD extension.

Some downstream projects would like to build in standards-compliance mode and it may also ease using commonly available C++11 features like unordered_map. While most compilers have some way of accessing isascii, its simpler to just replace all with calls to Scintilla's IsASCII function (which should behave identically) so that has been done.

While this has a low chance of causing problems, if a lexer starts behaving differently to before then its something to look for.

New lexers and lexer modifications should now always use IsASCII.

M_PI is another non-standard identifier and has been replaced with a local constant definition kPi in PlatGTK.cxx.

All core code and the Windows, GTK+, and Cocoa platforms now build with g++ in --std=c++98 or --std=c++0x modes and the corresponding make files have --std=c++0x.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...