Reddit Programming
207 subscribers
1.22K photos
123K links
I will send you newest post from subreddit /r/programming
Download Telegram
C3 0.7.3 released - improvements and bug fixes
https://www.reddit.com/r/programming/comments/1lsxbpo/c3_073_released_improvements_and_bug_fixes/

<!-- SC_OFF -->A sample of improvements type / typeid equivalence: it's possible to use a constant typeid instead of type in a lot more places now, requiring fewer typeid -> type conversions, which improves readability. $evaltype which turned a string into a type now merged into $typefrom which is the one that turns a typeid into a type. Type inference through && (taking a reference to a temporary), allowing Foo* f = &&{ 1, 2 }. Compile time "sprintf" for formating strings at compile time. Arithmetic operator overloading now accepts macros with untyped "wildcard" arguments. The full list of changes: Changes / improvements $typefrom now also accepts a constant string, and so works like $evaltype. $evaltype is deprecated in favour of $typefrom. Literal rules have changed, this makes -0xFF now a signed integer. Implicitly convert from constant typeid to Type in $Type assignment, and $assignable. Make $Type parameters accept constant typeid values. Deprecate foo.#bar. Allow inference across && #2172. Added support for custom file extensions in project.json targets. $eval now also works with @foo, #foo, $Foo and $foo parameters #2114. @sprintf macro (based on the $$sprintf builtin) allows compile time format strings #1874. Improve error reports when encountering a broken "if-catch". Add printf format to $assert and $error #2183. Make accepting arguments for main a bit more liberal, accepting main(int argc, ZString* argv) Make $echo and @sprintf correctly stringify compile time initializers and slices. Add --sources build option to add additional files to compile. #2097 Support untyped second argument for operator overloading. The form-feed character '\f' is no longer valid white space. Show code that caused unreachable code #2207 Allow generics over distinct types #2216. Support distrinct types as the base type of bitstructs. #2218 Add hash::sha512 module to stdlib. #2227 Compile time type assignment (eg $Foo = int) is no longer an expression. Add @allow_deprecated attribute to functions to selectively allow deprecated declarations #2223. Improve error message on pointer diff #2239. Compile-time comparison of constant vectors. #1575. $member.get supports bitstructs. $member.set for setting members without the *& trick. Initial support for #1925, does not affect C compilation yet, and doesn't try to link etc. Using "--emit-only" Fixes -2147483648, MIN literals work correctly. Splatting const slices would not be const. #2185 Fixes to $define handling of binary ops. Fixes methodsof to pick up all sorts of extension methods. #2192 --lsp sometimes does not emit end tag #2194. Improve Android termux detection. Update Android ABI. Fixes to @format checking #2199. Distinct versions of builtin types ignore @operator overloads #2204. @operator macro using untyped parameter causes compiler segfault #2200. Make unreachable() only panic in safe mode. cflags additions for targets was not handed properly. #2209 $echo would suppress warning about unreachable code. #2205 Correctly format '%c' when given a width. #2199 Fix to is_array_or_slice_of_char #2214. Method on array slice caused segfault #2211. In some cases, the compiler would dereference a compile time null. #2215 Incorrect codegen if a macro ends with unreachable and is assigned to something. #2210 Fix error for named arguments-order with compile-time arguments #2212 Bug in AST copying would make operator overloading like += compile incorrectly #2217. $defined(#expr) broken with binary. #2219 Method ambiguity when importing parent module publicly in private submodule. #2208 Linker errors when shadowing @local with public function #2198 Bug when offsetting pointers of large structs using ++ and --. x++ and x-- works on pointer vectors #2222. x += 1 and x -= 1 works propertly on pointer vectors #2222. Fixes to x += { 1, 1 } for enum and