C3 version 0.6.7
Changes / improvements
- Contracts @require/@Ensure are no longer treated as conditionals, but must be explicitly bool.
- Add
win-debugsetting to be able to pick dwarf for output #1855. - Error on switch case fallthough if there is more than one newline #1849.
- Added flags to
c3c project viewto filter displayed properties - Compile time array assignment #1806.
- Allow
+++to work on all types of arrays. - Allow
(int[*]) { 1, 2 }cast style initialization. - Experimental change from
[*]to[?] - Warn on if-catch with just a
defaultcase. - Compile time array inc/dec.
- Improve error message when using ',' in struct declarations. #1920
- Compile time array assign ops, e.g.
$c[1] += 3#1890. - Add
inlineto enums #1819. - Cleaner error message when missing comma in struct initializer #1941.
- Distinct inline void causes unexpected error if used in slice #1946.
- Allow
fn int test() => @pool() { return 1; }short function syntax usage #1906. - Test runner will also check for leaks.
- Improve inference on
??#1943. - Detect unaligned loads #1951.
Fixes
- Fix issue requiring prefix on a generic interface declaration.
- Fix bug in SHA1 for longer blocks #1854.
- Fix lack of location for reporting lambdas with missing return statement #1857.
- Compiler allows a generic module to be declared with different parameters #1856.
- Fix issue with
@constwhere the statement$foo = 1;was not considered constant. - Const strings and bytes were not properly converted to compile time bools.
- Concatenating a const empty slice with another array caused a null pointer access.
- Fix
linux-crtandlinux-crtbeginnot getting recognized as a project paramater - Fix dues to crash when converting a const vector to another vector #1864.
- Filter
$execoutput from\r, which otherwise would cause a compiler assert #1867. - Fixes to `"exec" use, including issue when compiling with MinGW.
- Correctly check jump table size and be generous when compiling it #1877.
- Fix bug where .min/.max would fail on a distinct int #1888.
- Fix issue where compile time declarations in expression list would not be handled properly.
- Issue where trailing body argument was allowed without type even though the definition specified it #1879.
- Fix issues with @jump on empty
defaultor onlydefault#1893 #1894 - Fixes miscompilation of nested
@jump#1896. - Fixed STB_WEAK errors when using consts in macros in the stdlib #1871.
- Missing error when placing a single statement for-body on a new row #1892.
- Fix bug where in dead code, only the first statement would be turned into a nop.
- Remove unused $inline argument to mem::copy.
- Defer is broken when placed before a $foreach #1912.
- Usage of @NoReturn macro is type-checked as if it returns #1913.
- Bug when indexing into a constant array at compile time.
- Fixing various issues around shifts, like
z <<= { 1, 2 }. return (any)&foowould not be reported as an escaping variable iffoowas a pointer or slice.- Incorrect error message when providing too many associated values for enum #1934.
- Allow function types to have a calling convention. #1938
- Issue with defer copying when triggered by break or continue #1936.
- Assert when using optional as init or inc part in a for loop #1942.
- Fix bigint hex parsing #1945.
bigint::from_int(0)throws assertion #1944.writeof qoi would leak memory.- Issue when having an empty
Pathor just "." set_envwould leak memory.- Fix issue where aligned bitstructs did not store/load with the given alignment.
- Fix issue in GrowableBitSet with sanitizers.
- Fix issue in List with sanitizers.
- Circumvent Aarch64 miscompilations of atomics.
- Fixes to ByteBuffer allocation/free.
- Fix issue where compiling both for asm and object file would corrupt the obj file output.
- Fix
pollandPOLL_FOREVER. - Missing end padding when including a packed struct #1966.
- Issue when scalar expanding a boolean from a conditional to a bool vector #1954.
- Fix issue when parsing bitstructs, preventing them from implementing interfaces.
- Regression
String! a; char* b = a.ptr;would incorrectly be allowed. - Fix issue where target was ignored for projects.
- Fix issue when dereferencing a constant string.
- Fix problem where a line break in a literal was allowed.
Stdlib changes
- Added '%h' and '%H' for printing out binary data in hexadecimal using the formatter.
- Added weakly linked
__powidf2 - Added channels for threads.
- New
std::core::testmodule for unit testing machinery. - New unit test default runner.
- Added weakly linked
fmodf. - Add
@selectto perform the equivalent ofa ? x : yat compile time. HashMapis nowPrintable.- Add
allocator::wrapto create an arena allocator on the stack from bytes.