Commit Graph

3983 Commits

Author SHA1 Message Date
Christoffer Lerno
14779bd467 Set CP_UTF8 to underlying number. 2026-02-14 01:49:03 +01:00
Christoffer Lerno
eb80776988 More fixes for typedef @constinit change 2026-02-14 01:37:53 +01:00
Samuel
fac9054f1b Fix array initializer analysis (#2925)
* Fix array initializer analysis: improved semantic checking for arrays with inferred or fixed length,
* Update phrasing

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-13 23:38:07 +01:00
Zack Puhl
768d24d580 [stdlib] Add array even, odd, and unlace macros 2026-02-13 23:19:31 +01:00
Christoffer Lerno
e299a4b630 - Change typedef and const enums to not convert from literals by default. (#2934)
- Add `@constinit` to allow old typedef behaviour.
2026-02-13 20:39:47 +01:00
Christoffer Lerno
bbf89815d6 - Individual warning settings added. 2026-02-13 18:25:19 +01:00
Christoffer Lerno
cc6d552e3d - --safe=no disabled compile-time errors on compile-time known runtime @require checks #2936 2026-02-13 16:34:45 +01:00
Christoffer Lerno
27ceded331 Add a few const char* 2026-02-12 16:51:34 +01:00
Christoffer Lerno
3f279b2f1c Refactoring: make CT_IDENT and unresolved expression. 2026-02-12 16:38:18 +01:00
Christoffer Lerno
acc4a900f5 - New const enum declaration syntax.
- New enum associated value syntax.
2026-02-12 14:43:56 +01:00
Fernando López Guevara
f079fa82b2 fix(std-io): make uint128 decimal formatting safe (#2924)
* fix(std-io): make uint128 decimal formatting safe and add all-base
numeric coverage
---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-11 23:50:16 +01:00
Manuel Barrio Linares
7665720264 add cache for Embedded/QEMU Tests
I forgot to add this one
2026-02-11 23:48:18 +01:00
Christoffer Lerno
83705ab340 Fix chacha20. 2026-02-11 23:44:26 +01:00
Christoffer Lerno
adea3dd83f Fix chacha20 2026-02-11 23:39:47 +01:00
Christoffer Lerno
9b52be9ba6 - unsigned % signed and unsigned / signed is no longer allowed without explicit casts, except for const denominators. #2928 2026-02-11 23:18:08 +01:00
Christoffer Lerno
202349d88f - Improved underlining errors/warnings when unicode is used. #2887 2026-02-11 16:49:22 +01:00
Manuel Barrio Linares
18ab18958b CI: add retries and package caching across all platforms
- Add retry loops to all package manager commands (apt, apk, pacman,
pkg).
- Implement daily package caching to minimize external server hits.
- Enable Docker layer caching in CI using buildx and GHA backend.
  - Sync CI Docker build steps with the build-with-docker.sh logic.
  - We don't, or more accurately, can't actually use
`build-with-docker.sh` anymore in CI. Maybe we should move it to
scripts/tools/ to keep the root directory clean.
- add ramdisk for BSD, shave 30/60 seconds.
- change BDSs to cross-platform-actions/action for a cleaner ci and skip
SLOW_TESTS for BSDs: this shaves a few seconds
- set global CACHE_INVALIDATION_SEED
2026-02-11 10:01:14 +01:00
Christoffer Lerno
2237d3b836 Missing check 2026-02-11 02:55:07 +01:00
Christoffer Lerno
e2f17a770b Using [] or .foo on $$ functions would not raise error but instead crash #2919. 2026-02-11 02:53:17 +01:00
konimarti
40e6a2c4a3 codepage: add single-byte code page support (#2891)
* codepage: add single-byte code page support

Add std::encoding::codepage with a shared engine for converting between
single-byte code pages and UTF-8 using table-driven mappings.

Introduce generated tables and wrappers for several code pages[1] each
exposing encode/decode helpers built on a common CodePageTable
structure.

The mapping data is generated by cpgen[2] from the Unicode Consortium’s
published code page mapping files and follows the Unicode standard’s
interpretation of control characters (abstract characters) rather than
historical VGA glyph shapes.

[1] Code page overview/groups:

    DOS/OEM code pages (legacy PC):
    cp437 cp737 cp775 cp850 cp852 cp855 cp857 cp860 cp861 cp862 cp863
    cp864 cp865 cp866 cp869 cp874

    Windows code pages (ANSI/Windows):
    cp1250 cp1251 cp1252 cp1253 cp1254 cp1255 cp1256 cp1257 cp1258

    ISO/IEC 8859 series (Latin/Regional):
    iso_8859_1 iso_8859_2 iso_8859_3 iso_8859_4 iso_8859_5 iso_8859_6
    iso_8859_7 iso_8859_8 iso_8859_9 iso_8859_10 iso_8859_11 iso_8859_13
    iso_8859_14 iso_8859_15 iso_8859_16

[2] github.com/konimarti/cpgen

Signed-off-by: Koni Marti <koni.marti@gmail.com>

* codepage: change encoding format, streamline api

* Use enum to collect the data.

---------

Signed-off-by: Koni Marti <koni.marti@gmail.com>
Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-11 01:10:12 +01:00
g.denis
a80e40a798 fix fedora dyn lib (#2917)
* also look into /usr/lib64
2026-02-10 23:12:04 +01:00
Manuel Barrio Linares
de8a733c77 Implement lazy-loaded libcurl
- Uses `dlopen` to load libcurl at runtime for better portability.
- Replaces the FETCH_AVAILABLE macro with download_available() check.
- Provides descriptive error messages when libcurl is missing.
2026-02-10 13:05:43 +01:00
Christoffer Lerno
c5d7a03859 Remove unnecessary free. 2026-02-10 11:46:26 +01:00
Christoffer Lerno
0b82537700 Fix 2026-02-10 11:27:55 +01:00
Christoffer Lerno
7b8299c8dd - Reallocating overaligned memory with the LibcAllocator was unsafe. 2026-02-10 11:23:51 +01:00
Christoffer Lerno
dcbd0f8f2d Fix dwarf definitions 2026-02-10 10:23:53 +01:00
Boris Barbulovski
402c00e230 Add Android Aarch64 and x64 support status 2026-02-09 10:26:40 +01:00
Christoffer Lerno
0542c05b88 Update tests. 2026-02-09 10:23:03 +01:00
Christoffer Lerno
67e224c62f Fix windows main 2026-02-09 10:15:49 +01:00
Christoffer Lerno
565b08846f Remove use of tempnam. 2026-02-09 00:04:05 +01:00
Christoffer Lerno
80ad0e02ad Fix tests and error in returning error on function name. 2026-02-08 22:54:24 +01:00
Lucas Alves
b8ee5a4150 fix: add non-API Android NDK lib search path (#2884)
* fix: add sysroot/usr/lib/<triple> to Android linker search paths

* Fix library search order: move libc++_shared logic after API libc paths

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-08 15:02:37 +01:00
Christoffer Lerno
445dd155b7 Another #2814 2026-02-08 15:01:27 +01:00
Rauny
abb3efca00 fix: prevent Homebrew dylib contamination in macOS builds (#2908)
When C3_FETCH_LLVM=ON, the fetched LLVM artifact is self-contained.
Two issues caused the macOS release binary to embed hardcoded
/opt/homebrew paths, making it fail on systems without Homebrew:

1. /opt/homebrew/lib was unconditionally appended to LLVM_LIBRARY_DIRS,
   causing find_library to discover Homebrew's LLD dylibs (whose
   LC_ID_DYLIB points to /opt/homebrew/opt/lld/lib/...). Guard this
   behind NOT C3_FETCH_LLVM so it only applies when using a
   system-installed LLVM.

2. In the static linking block (C3_LINK_DYNAMIC=OFF), find_library NAMES
   listed .dylib before .a, so shared libraries were preferred even when
   static linking was intended. Reorder to prefer .a, keeping .dylib as
   a fallback for systems that only ship shared libraries.

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-08 13:57:07 +01:00
Christoffer Lerno
de0b317461 Fix default main template. 2026-02-08 13:38:43 +01:00
Christoffer Lerno
21758476d4 - For c3c init with library templates, provide example exported functions. #2898 2026-02-07 21:31:12 +01:00
Christoffer Lerno
b69f78be30 Flag --cpu-flags doesn't work if the first item is an exclusion. #2905 2026-02-07 21:21:57 +01:00
Christoffer Lerno
89b9f52f1e Add libc mktemp and tempnam. Update test. 2026-02-07 20:25:28 +01:00
Christoffer Lerno
02a67254cc Fix win forwarding functions. 2026-02-07 19:57:43 +01:00
Manuel Barrio Linares
120f56ac5f disable --fetch-msvc when no curl 2026-02-07 01:22:54 +01:00
Laura Kirsch
5b93212f43 Added Xorshiro128++ random number generator. (#2846)
* Added Xorshiro128++ random number generator.

* Fixes to xorshiro implementation + tests.

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-06 20:14:56 +01:00
Zack Puhl
c57415ea78 Optional byte limit for readline
---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
Co-authored-by: Christoffer Lerno <christoffer.lerno@gmail.com>
2026-02-06 19:15:29 +01:00
Manuel Barrio Linares
36dfbdff45 implement progress bar for fetch-msvc
using deterministic milestones
2026-02-06 17:59:36 +01:00
Christoffer Lerno
d07e454dfe Fix missing ) 2026-02-06 17:56:40 +01:00
Christoffer Lerno
40aa4d4dcd Add Murmur3 hash 2026-02-06 17:53:19 +01:00
Manu Linares
0be291e0d7 compiler: added c3c fetch-msvc command (#2854)
* compiler: added `c3c fetch-msvc` command
ported `msvc_build_libraries.py` to built-in compiler 'fetch-msvc'
subcommand.
* fix alpine build
* fix windows build
* fix WinHTTP download to correctly handle full URLs by splitting hostname and path.
* fix old `cp` and escape args for `file_copy_file`
also cleanup the temp directory when we are finished
it would be better to use a cache :|
* remove msiextract dependency
* Auto-fetch `msvc_sdk` if missing
- auto trigger `msvc_sdk` download when compiling for Windows if no SDK
is detected.
- make native Windows SDK detection non-fatal to allow fallback to the
portable SDK
- add debug logging for diagnostics
* removed the LZX decompression logic
- moved `msvc_sdk` to user cache locations to avoid permission issues.
- refined terminal messaging for better accuracy and clarity.
* use %LOCALAPPDATA% on Windows
* Add support for C3_MSVC_SDK
* Update release notes.

---------

Co-authored-by: Christoffer Lerno <christoffer@aegik.com>
2026-02-06 14:01:49 +01:00
Manuel Barrio Linares
35d84390bd Simplify CI, do more with less.
- Rename Docker job to **"LLVM ${{ matrix.llvm_version }}
Compatibility"** for better visibility.
- Limit `build_type` to **Debug** for MSYS2, OpenBSD, NetBSD, and Nix
jobs to reduce CI time.
- Refactor **Alpine Linux** job: updated to 3.23, simplified dependency
installation, and removed redundant LLVM matrix.
- Modernize **Docker** builds:
    - Added automatic architecture detection (x86_64/ARM) for CMake
downloads.
    - Generalized LLVM repository logic to support multiple Ubuntu
codenames (Focal/Jammy/Noble).
    - Fixed git permissions issues in containerized builds using
`safe.directory`.
- Standardized Android build packaging and added conditional testing for
Debug builds.
2026-02-06 12:00:00 +01:00
Christoffer Lerno
124efb2684 Improve error message on const int* 2026-02-06 02:00:26 +01:00
Christoffer Lerno
5c158e481b Always have wmain. Cleanup synthetic main generation. Some cleanup for generics. 2026-02-06 01:28:19 +01:00
Christoffer Lerno
42b79d19c1 Update all stub methods. 2026-02-06 00:55:57 +01:00