Closed Hirrolot closed 2 years ago
Trying to compile examples/binary_tree.c on C++:
examples/binary_tree.c
$ g++ examples/binary_tree.c -I. -Iexamples/build/_deps/metalang99-src/include -ftrack-macro-expansion=0 examples/binary_tree.c: In function ‘int sum(const BinaryTree*)’: examples/binary_tree.c:17:9: error: invalid conversion from ‘void*’ to ‘Leaf_0*’ {aka ‘int*’} [-fpermissive] 17 | of(Leaf, x) return *x; | ^~ | | | void* examples/binary_tree.c:17:9: error: invalid conversion from ‘void*’ to ‘Leaf_0*’ {aka ‘int*’} [-fpermissive] 17 | of(Leaf, x) return *x; | ^~ | | | void* examples/binary_tree.c:18:9: error: invalid conversion from ‘void*’ to ‘BinaryTree**’ [-fpermissive] 18 | of(Node, lhs, x, rhs) return sum(*lhs) + *x + sum(*rhs); | ^~ | | | void* examples/binary_tree.c:18:9: error: invalid conversion from ‘void*’ to ‘BinaryTree**’ [-fpermissive] 18 | of(Node, lhs, x, rhs) return sum(*lhs) + *x + sum(*rhs); | ^~ | | | void* examples/binary_tree.c:18:9: error: invalid conversion from ‘void*’ to ‘Node_1*’ {aka ‘int*’} [-fpermissive] 18 | of(Node, lhs, x, rhs) return sum(*lhs) + *x + sum(*rhs); | ^~ | | | void* examples/binary_tree.c:18:9: error: invalid conversion from ‘void*’ to ‘Node_1*’ {aka ‘int*’} [-fpermissive] 18 | of(Node, lhs, x, rhs) return sum(*lhs) + *x + sum(*rhs); | ^~ | | | void* examples/binary_tree.c:18:9: error: invalid conversion from ‘void*’ to ‘BinaryTree**’ [-fpermissive] 18 | of(Node, lhs, x, rhs) return sum(*lhs) + *x + sum(*rhs); | ^~ | | | void* examples/binary_tree.c:18:9: error: invalid conversion from ‘void*’ to ‘BinaryTree**’ [-fpermissive] 18 | of(Node, lhs, x, rhs) return sum(*lhs) + *x + sum(*rhs); | ^~ | | | void*
This is caused by https://github.com/Hirrolot/metalang99/issues/25 and was fixed in Metalang99 v1.13.2.
Trying to compile
examples/binary_tree.c
on C++:This is caused by https://github.com/Hirrolot/metalang99/issues/25 and was fixed in Metalang99 v1.13.2.