Christoffer Lerno
1994cba73e
Fix default #foo args.
2025-01-02 15:23:21 +01:00
vssukharev
55cdcbb39b
Fix typo in libc: SIGABTR -> SIGABRT
2025-01-01 21:36:33 +01:00
Christoffer Lerno
c7ce6230db
Update test with target.
2025-01-01 21:02:16 +01:00
Christoffer Lerno
7c45ae24ae
Macros with default arguments to &, # and type parameters didn't work as expected. #1754 .
2025-01-01 17:52:32 +01:00
Christoffer Lerno
99c350fc43
Fix error where panic would not properly stop the program when stacktrace couldn't be printed #1751 .
2025-01-01 13:00:04 +01:00
Christoffer Lerno
faf1c5cb64
Introduce EXPR_RVALUE for some additional refactoring.
2025-01-01 12:19:00 +01:00
Radek Micek
ece6efc75e
Fix fputc
2025-01-01 12:17:58 +01:00
Christoffer Lerno
0a809ab5f0
Allow using 'var' to declare lambdas in functions.
2025-01-01 01:02:35 +01:00
Christoffer Lerno
78ff1a4af5
Support experimental @operator(construct) operator overload.
2025-01-01 00:45:42 +01:00
Christoffer Lerno
c0dcae4f1d
Improve ordering of method registration to support adding methods to generic modules with method constraints #1746
2024-12-31 18:15:38 +01:00
Christoffer Lerno
5e32c8a828
Improve posix thread error handling.
2024-12-31 17:27:13 +01:00
Christoffer Lerno
4d15a2f45e
Improve error reporting when using type names as the function argument #1750 .
2024-12-31 16:59:51 +01:00
Christoffer Lerno
a913f21c45
Fix issue with compiling a constant struct containing a string array in a local context.
2024-12-31 16:45:10 +01:00
Christoffer Lerno
322c70433b
Refactoring, stop using int to bool as cast. Merge make any.
2024-12-31 16:32:37 +01:00
Christoffer Lerno
ad9cfcdcc7
Fix typo.
2024-12-30 18:24:01 +01:00
Christoffer Lerno
4232c9d2b0
Fix bug when including compile time parameters in trailing body more than once.
2024-12-30 17:57:36 +01:00
antek-bizon
9edd59d280
Add compilation guide for Fedora
2024-12-30 13:56:29 +01:00
Christoffer Lerno
df74cbf06f
Fix bug where !! and ! was not recognized to jump out of the current scope. Remove more casts.
2024-12-30 01:43:02 +01:00
Christoffer Lerno
5af224ab16
Remove 3 casts and replace them with a single new normal expression node.
2024-12-30 00:55:40 +01:00
vssukharev
7b734df09e
Several nix fixes ( #1737 )
...
* Fixed nix c3c development shell
* Fix unknown git hash on nix build
2024-12-29 21:12:26 +01:00
Christoffer Lerno
1340a47bc2
- any_to_int checks value to be int and no longer works with enum.
...
- Add check in formatter printing "%c".
2024-12-29 17:07:00 +01:00
Book-reader
4f4476ba75
fix typo in @require statement in builtin.c3
2024-12-29 12:24:36 +01:00
Christoffer Lerno
5c7a183f8a
Change CBool to be 1 byte.
2024-12-28 22:46:26 +01:00
Taylor W
53bada2a1e
math::nolibc: atanh ( #1730 )
...
* math::nolibc: log1p
* math::no_libc: atanh
Added atanh nolibc definition and more test points in the math_tests
module.
2024-12-28 21:13:44 +01:00
Totto16
43efb7df2f
fix: use helper printing macros, to use the correct printing width (e.g. %llu vs %lu)
2024-12-28 19:21:39 +01:00
Christoffer Lerno
f5cea221a6
Miscompile when indexing an array with small unsigned types.
2024-12-28 17:39:25 +01:00
Christoffer Lerno
b7082f34a1
C backend work.
2024-12-28 17:09:43 +01:00
Christoffer Lerno
d20d957881
Add @enum_from_value
2024-12-27 23:21:36 +01:00
Christoffer Lerno
008274cda5
Update the release notes.
2024-12-27 22:35:28 +01:00
Alexey Kutepov
e07ab7547f
Fix Segfault and UX of the c3c project add-target subcommand ( #1729 )
...
* Fix UX of the `c3c project add-target` subcommand
- Fix segfault on `project.json` containing empty map `{}`
- Enable `add-target` to operate on non-existing project files
- Extend `add-target` syntax to accept source through CLI args
This enables the following workflow without friction and needless
crashes:
```console
$ cat > main.c3 <<END
import std::io;
fn void main() {
io::printfn("Hello, World");
}
END
$ c3c project add-target main executable main.c3
$ c3c run
```
* Fix read_project() call in fetch_project()
* Keep the style of curlies consistent
2024-12-27 22:33:57 +01:00
Christoffer Lerno
cf10837eb8
Add static lib for MSVC
2024-12-27 21:46:08 +01:00
Christoffer Lerno
291b26f230
Add static lib.
2024-12-27 02:05:40 +01:00
Christoffer Lerno
08e8c9bf57
Use weak on dyn-symbols on Linux.
2024-12-27 02:05:40 +01:00
Christoffer Lerno
625152440c
Use weak_odr rather than weak on Windows which seems to prevent issues such as #1704 . Fix regression.
2024-12-26 21:35:41 +01:00
Aaron
fbd51821d1
Fixed -P JSON syntax, string conversion. ( #1714 )
...
* Fix JSON formatting in parse command, strings now "JSON-legal"
* Clean up
* Implemented JSON for CONST_BYTES
* Handle empty byte string, slightly more concise
* of course msvc is the *only* compiler that complains about this
2024-12-26 02:18:49 +01:00
Christoffer Lerno
c3ebf51295
Add "name" project property to override the name of the resulting binary. #1719
2024-12-26 02:15:45 +01:00
Christoffer Lerno
9a9ff7f32c
Fix bug in OnStackAllocator when freeing overallocated data. # #1720
2024-12-25 23:57:47 +01:00
Christoffer Lerno
7b73eec82b
Prevent DString from being initialized with "".
2024-12-25 23:40:58 +01:00
Christoffer Lerno
75ba4a1cdb
Incorrectly handles distinct enums and pointers with '+=' and '-=' #1717 .
2024-12-25 23:09:10 +01:00
Christoffer Lerno
e5ca9065bd
Deprecate cast conversion from enum -> integer.
2024-12-25 20:34:28 +01:00
Taylor Wampler
1042d0825f
Fixed typo in atan.c3
2024-12-25 19:15:59 +01:00
Christoffer Lerno
17942925f5
Fix bug in temp allocator when temp memory is exhausted and allocation needs overaligned mem. #1715
2024-12-25 17:56:37 +01:00
Christoffer Lerno
7424317d03
Fix call to copy.
2024-12-25 00:16:35 +01:00
Christoffer Lerno
dbf1d91961
Add --win-vs-dirs to override VS detection dirs.
2024-12-25 00:07:57 +01:00
Christoffer Lerno
eb1644b302
Change included common options.
2024-12-24 20:43:52 +01:00
Christoffer Lerno
cde5bc3263
Change included common options.
2024-12-24 20:39:24 +01:00
Taylor Wampler
e995e289db
math::nolibc: acos and asin
...
There are now nolibc definitions for the inverse cosine and inverse
sine.
More test points were added for acos, asin, and atan in the math_tests module.
This was done becuase the nolibc inverse trigonometric functions have
various branching conditions depending on the provided input value. Several
branches in these functions were neglected.
2024-12-24 11:29:32 +01:00
Taylor W
5020caa9c3
C3_MATH feature ( #1709 )
...
* C3_MATH feature
This feature allows the usage of noclib math files even when libc is in use.
If a nolibc symbol exists, it will be used in place of libc, otherwise
it will default to libc.
* Added MIT License notices to atan.c3
2024-12-23 23:42:57 +01:00
Aaron
f34eb7d9f3
Prevent trailing _ for all numbers ( #1706 )
...
* moved _ check to scan_number_suffix
* Skipping underscore on list-operators command
* Disallow # from operator, update release notes
2024-12-23 21:23:46 +01:00
Guillaume M.
bf74ef0e5e
Fix crt detection for Arch Linux ( #1705 )
...
* Fix crt detection for arch linux
On archlinux, the crt is located directly in /usr/lib. Thus, the globbing done in find_linux_crt fails since it expects the crt to be in a subdirectory of /usr/lib. This patch fixes this issue.
2024-12-23 20:03:53 +01:00