.. this would otherwise cause a memory use error in the unusual case
where a numeric identifer held more letters than expected.
For instance, passing the following file as the input to tst_inverse_attr3:
ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('SCL test file'),'2;1');
FILE_NAME('test_inverse_attr.p21','2012-06-30T',('mp'),(''),'0','1','2');
FILE_SCHEMA(('test_inverse_attr'));
ENDSEC;
DATA;
ENDSEC;
END-ISO-10303-21;
and running it under valgrind can cause a diagnostic similar to the following to be displayed:
Mismatched free() / delete / delete []
at 0x4C2D2DB: operator delete(void*) (vg_replace_malloc.c:576)
by 0x507A5A6: sectionReader::readInstanceNumber() (sectionReader.cc:224)
by 0x507CCC7: lazyP21DataSectionReader::nextInstance() (lazyP21DataSectionReader.cc:53)
by 0x507C797: lazyP21DataSectionReader::lazyP21DataSectionReader(lazyFileReader*, std::basic_ifstream<char, std::char_traits<char> >&, std::fpos<__mbstate_t>, unsigned short) (lazyP21DataSectionReader.cc:11)
by 0x50699F2: lazyFileReader::initP21() (lazyFileReader.cc:14)
by 0x5069E5D: lazyFileReader::lazyFileReader(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, lazyInstMgr*, unsigned short) (lazyFileReader.cc:61)
] and delete[]
by 0x506AAA7: lazyInstMgr::openFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) (lazyInstMgr.cc:103)
by 0x4023A1: main (inverse_attr3.cc:35)
Address 0x6a861a0 is 0 bytes inside a block of size 21 alloc'd
at 0x4C2C93F: operator new[](unsigned long) (vg_replace_malloc.c:423)
by 0x507A3A7: sectionReader::readInstanceNumber() (sectionReader.cc:202)
This problem is also reported in static analysis by clang, and as such can be seen in travis ci build logs.
|
||
|---|---|---|
| cmake | ||
| data | ||
| doc | ||
| example/ap203min | ||
| include | ||
| misc | ||
| src | ||
| test | ||
| .appveyor.yml | ||
| .gitignore | ||
| .travis.yml | ||
| AUTHORS | ||
| ChangeLog | ||
| CMakeLists.txt | ||
| CONTRIBUTING.md | ||
| COPYING | ||
| ctest_matrix.cmake | ||
| CTestConfig.cmake | ||
| INSTALL | ||
| lcov.cmake | ||
| NEWS | ||
| README.md | ||
| run_ctest.cmake | ||
| SC_VERSION.txt | ||
| Travis-CI | AppVeyor CI |
|---|---|
| Linux, OSX (LLVM) | Windows (MSVC) |
STEPcode v0.8 -- stepcode.org, github.com/stepcode/stepcode
-
What is STEPcode? SC reads ISO10303-11 EXPRESS schemas and generates C++ source code that can read and write Part 21 files conforming to that schema. In addition to C++, SC includes experimental support for Python.
-
Renamed in April/May 2012: SC was formerly known as STEP Class Libraries, SCL for short. It was renamed because the name wasn't accurate: the class libraries make up only a part of the code.
-
Much of the work to update SC has been done by the developers of BRL-CAD, and SC (then STEP Class Library) was originally created at NIST in the 90's.
-
For information on changes version-by-version, see the NEWS file
-
Building and testing SCL - see the INSTALL file
-
For more details on the libraries and executables, see the wiki: http://github.com/stepcode/stepcode/wiki/About-STEPcode
-
For license details, see the COPYING file. Summary: 3-clause BSD.
CODING STANDARDS
SC's source has been reformatted with astyle. When making changes, try to match the current formatting. The main points are:
- compact (java-style) brackets:
if( a == 3 ) {
c = 5;
function( a, b );
} else {
somefunc( );
}
- indents are 4 spaces
- no tab characters
- line endings are LF (linux), not CRLF (windows)
- brackets around single-line conditionals
- spaces inside parentheses and around operators
- return type on the same line as the function name, unless that's too long
- doxygen-style comments (see http://www.stack.nl/~dimitri/doxygen/docblocks.html)
If in doubt about a large patch, run astyle with the config file misc/astyle.cfg. Download astyle from http://sourceforge.net/projects/astyle/files/astyle/
For more info, see the wiki.