scc, branch HEADsimple c99 compiler
52cf2e9986d52e8e812a30b94dc118dabb1aea1f2026-01-05T21:22:18Z2026-01-05T21:22:18Zlibmach: Add findseg()Roberto E. Vargas Caballerok0ga@shike2.netcommit 52cf2e9986d52e8e812a30b94dc118dabb1aea1f
parent ece7fade7d459523af266428e95b4f587a2f0ba9
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 5 Jan 2026 22:22:18 +0100
libmach: Add findseg()
This function returns the segment index in the map. This function is
mainly designed to be used in elf where there is a difference between
sections and segments.
ece7fade7d459523af266428e95b4f587a2f0ba92026-01-05T20:33:03Z2026-01-05T20:52:49Ztests/libc: Add 0067-wcwidthRoberto E. Vargas Caballerok0ga@shike2.netcommit ece7fade7d459523af266428e95b4f587a2f0ba9
parent 361a63ace0c9cec71586b8c6f79397a981c32589
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 5 Jan 2026 21:33:03 +0100
tests/libc: Add 0067-wcwidth
361a63ace0c9cec71586b8c6f79397a981c325892026-01-05T20:19:16Z2026-01-05T20:51:16Zobjdump: Fix format string in dumpscns()Roberto E. Vargas Caballerok0ga@shike2.netcommit 361a63ace0c9cec71586b8c6f79397a981c32589
parent 0f88acf52504636f56b73132285c7355b1beb0af
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 5 Jan 2026 21:19:16 +0100
objdump: Fix format string in dumpscns()
0f88acf52504636f56b73132285c7355b1beb0af2026-01-05T19:24:01Z2026-01-05T20:51:16Zlibc: Include a mbstate_t in FILERoberto E. Vargas Caballerok0ga@shike2.netcommit 0f88acf52504636f56b73132285c7355b1beb0af
parent 84128eaf37e33fed023f271018b157b7398ad91c
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 5 Jan 2026 20:24:01 +0100
libc: Include a mbstate_t in FILE
Several of the file operations related to wchar require
a mbstate_t, and every stream should have its own mbstate_t
and not using the hidden state of several of the conversion
functions.
84128eaf37e33fed023f271018b157b7398ad91c2026-01-04T20:18:49Z2026-01-04T20:18:49Zlibc/stdlib: Minor improvements to realloc()Roberto E. Vargas Caballerok0ga@shike2.netcommit 84128eaf37e33fed023f271018b157b7398ad91c
parent ae0058502d81d2742783b1d1800784319341ff12
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 21:18:49 +0100
libc/stdlib: Minor improvements to realloc()
ae0058502d81d2742783b1d1800784319341ff122026-01-04T20:14:43Z2026-01-04T20:14:43Zlibc/wchar: Whitespace changeRoberto E. Vargas Caballerok0ga@shike2.netcommit ae0058502d81d2742783b1d1800784319341ff12
parent 117e2caee5ca7b1441e2e4c4135c2aaac7b5cc78
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 21:14:43 +0100
libc/wchar: Whitespace change
117e2caee5ca7b1441e2e4c4135c2aaac7b5cc782026-01-04T20:09:03Z2026-01-04T20:09:03Ztests: Minor improvementsRoberto E. Vargas Caballerok0ga@shike2.netcommit 117e2caee5ca7b1441e2e4c4135c2aaac7b5cc78
parent 0f61a6528784b5add0eef1d64ea16eb5adf689f9
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 21:09:03 +0100
tests: Minor improvements
0f61a6528784b5add0eef1d64ea16eb5adf689f92026-01-04T19:48:34Z2026-01-04T20:06:08Zlibc/string: Minor improvementsRoberto E. Vargas Caballerok0ga@shike2.netcommit 0f61a6528784b5add0eef1d64ea16eb5adf689f9
parent 9a60d2a80efcd85c85f90b1c0406c8fe3f324f5b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 20:48:34 +0100
libc/string: Minor improvements
9a60d2a80efcd85c85f90b1c0406c8fe3f324f5b2026-01-04T19:29:39Z2026-01-04T20:06:08Zlibc/wchar: Add wctob()Roberto E. Vargas Caballerok0ga@shike2.netcommit 9a60d2a80efcd85c85f90b1c0406c8fe3f324f5b
parent c4b7399c26bf3040f33b4760e162495d74d85d73
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 20:29:39 +0100
libc/wchar: Add wctob()
c4b7399c26bf3040f33b4760e162495d74d85d732026-01-04T19:17:51Z2026-01-04T19:22:52Zlibc/wchar: Add btowc()Roberto E. Vargas Caballerok0ga@shike2.netcommit c4b7399c26bf3040f33b4760e162495d74d85d73
parent 534e0b91e27ad3cb37404d696cd1c0044a8ebe18
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 20:17:51 +0100
libc/wchar: Add btowc()
534e0b91e27ad3cb37404d696cd1c0044a8ebe182026-01-04T18:47:25Z2026-01-04T18:47:25Ztests/libc: Add 0043-wcsrtombsRoberto E. Vargas Caballerok0ga@shike2.netcommit 534e0b91e27ad3cb37404d696cd1c0044a8ebe18
parent 005f4c376c05bd22e21761cf063ea76fb9338dc1
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 19:47:25 +0100
tests/libc: Add 0043-wcsrtombs
005f4c376c05bd22e21761cf063ea76fb9338dc12026-01-03T17:55:53Z2026-01-03T17:55:53Zlibc: Add wcstokRoberto E. Vargas Caballerok0ga@shike2.netcommit 005f4c376c05bd22e21761cf063ea76fb9338dc1
parent b2eb6e5269977992d88d388ff30a078aa9101a42
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 3 Jan 2026 18:55:53 +0100
libc: Add wcstok
b2eb6e5269977992d88d388ff30a078aa9101a422026-01-03T17:37:44Z2026-01-03T17:37:44Zlibc: Reorder common-objs.mkRoberto E. Vargas Caballerok0ga@shike2.netcommit b2eb6e5269977992d88d388ff30a078aa9101a42
parent 836ed99e5aa87033470b3594597070cb0e00148b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 3 Jan 2026 18:37:44 +0100
libc: Reorder common-objs.mk
836ed99e5aa87033470b3594597070cb0e00148b2026-01-03T16:47:00Z2026-01-03T16:47:00ZMerge remote-tracking branch 'origin/master'Roberto E. Vargas Caballerok0ga@shike2.netcommit 836ed99e5aa87033470b3594597070cb0e00148b
parent 452190b652a22d2d5ba1fbc2106bf7847944f582
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 3 Jan 2026 17:47:00 +0100
Merge remote-tracking branch 'origin/master'
47361f9afa1e1b5b31f58052d3253e1067dcd7732026-01-03T14:35:47Z2026-01-03T14:35:47Zbuild: Build bootstrap make in scriptsRoberto E. Vargas Caballerok0ga@shike2.netcommit 47361f9afa1e1b5b31f58052d3253e1067dcd773
parent 5b69547863e7e3da563e26164c34f22585920377
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 3 Jan 2026 15:35:47 +0100
build: Build bootstrap make in scripts
Just to keep the top level directory cleaner.
5b69547863e7e3da563e26164c34f225859203772026-01-03T14:24:55Z2026-01-03T14:24:55Ztests: Use $TEST in every scc invocationRoberto E. Vargas Caballerok0ga@shike2.netcommit 5b69547863e7e3da563e26164c34f22585920377
parent 6d67d778d8a2bfe2093233d1fae81663f712aa2a
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 3 Jan 2026 15:24:55 +0100
tests: Use $TEST in every scc invocation
using a variable before executing any of the commands allows to use
emulators of checkers easilly just setting that variable.
6d67d778d8a2bfe2093233d1fae81663f712aa2a2026-01-03T13:14:58Z2026-01-03T14:23:30Zbuild: Fix use of trapRoberto E. Vargas Caballerok0ga@shike2.netcommit 6d67d778d8a2bfe2093233d1fae81663f712aa2a
parent c825c03e6f3b1e3a757a47c75d77ce57ebb1624d
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 3 Jan 2026 14:14:58 +0100
build: Fix use of trap
Using the same trap for EXIT and signals has the problem that
signals don't finish the current execution. For that reason
is better to use different traps and do the cleaning only in
the EXIT trap while the signals just use exits that eventually
will call the EXIT trap.
452190b652a22d2d5ba1fbc2106bf7847944f5822025-11-18T15:47:52Z2025-11-18T18:14:23Zinclude: Remove parameter names in prototypesRoberto E. Vargas Caballerok0ga@shike2.netcommit 452190b652a22d2d5ba1fbc2106bf7847944f582
parent 87e4396fb51faf4eac6fbd0a853e8c9d93c88fa2
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 18 Nov 2025 16:47:52 +0100
include: Remove parameter names in prototypes
Just be consistent and apply the same style in all the files.
87e4396fb51faf4eac6fbd0a853e8c9d93c88fa22025-11-18T14:26:53Z2025-11-18T18:14:23Zinclude: Remove extern in function declarationsRoberto E. Vargas Caballerok0ga@shike2.netcommit 87e4396fb51faf4eac6fbd0a853e8c9d93c88fa2
parent ad5bd51963863fe5a3c3ad58a1ae42d578aa8980
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 18 Nov 2025 15:26:53 +0100
include: Remove extern in function declarations
This was introduced some time ago to follow some style
but it does not help so much, and it only makes longer
the declaration of the functions.
ad5bd51963863fe5a3c3ad58a1ae42d578aa89802025-11-18T13:01:45Z2025-11-18T18:12:31Zinclude: Remove T* typesRoberto E. Vargas Caballerok0ga@shike2.netcommit ad5bd51963863fe5a3c3ad58a1ae42d578aa8980
parent c825c03e6f3b1e3a757a47c75d77ce57ebb1624d
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 18 Nov 2025 14:01:45 +0100
include: Remove T* types
These types didn't work very well, and at some point we stopped
using them. Removing them makes the code more straigh forward
and avoids some stupid casts in printf alike function calls.
c825c03e6f3b1e3a757a47c75d77ce57ebb1624d2025-11-18T10:46:36Z2025-11-18T11:07:16Zdoc: Remove outdated bugRoberto E. Vargas Caballerok0ga@shike2.netcommit c825c03e6f3b1e3a757a47c75d77ce57ebb1624d
parent 3d92a3b0d83de06ce99f320906711d2d21f9a0c4
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 18 Nov 2025 11:46:36 +0100
doc: Remove outdated bug
3d92a3b0d83de06ce99f320906711d2d21f9a0c42025-10-31T17:19:56Z2025-10-31T17:19:56Ztests/ar: Fix file name in 0039-update.shRoberto E. Vargas Caballerok0ga@shike2.netcommit 3d92a3b0d83de06ce99f320906711d2d21f9a0c4
parent 1ed0ff0000999561feee336c289252faf2502a7e
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 31 Oct 2025 18:19:56 +0100
tests/ar: Fix file name in 0039-update.sh
1ed0ff0000999561feee336c289252faf2502a7e2025-10-29T09:57:06Z2025-10-29T09:57:06Ztests: Set error codeRoberto E. Vargas Caballerok0ga@shike2.netcommit 1ed0ff0000999561feee336c289252faf2502a7e
parent 00bae5c394c9b1d31586ffa1ee2f77a3edcc6f0a
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 29 Oct 2025 10:57:06 +0100
tests: Set error code
Having a correct error code when make tests is executed helps to detect
when a test failed.
00bae5c394c9b1d31586ffa1ee2f77a3edcc6f0a2025-10-28T20:21:11Z2025-10-28T20:21:11Ztests/make: Reduce the timeout for 0102-signalRoberto E. Vargas Caballerok0ga@shike2.netcommit 00bae5c394c9b1d31586ffa1ee2f77a3edcc6f0a
parent 65e5c373ca2fa947a604a1e0ea35843c8c104658
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 28 Oct 2025 21:21:11 +0100
tests/make: Reduce the timeout for 0102-signal
This timeout never had to be changed, because changing it
was only hiding the actual problem, which was a race condition
due to the incorrect signal handling.
65e5c373ca2fa947a604a1e0ea35843c8c1046582025-10-28T20:12:08Z2025-10-28T20:12:08Zmake: Use a local signal variableRoberto E. Vargas Caballerok0ga@shike2.netcommit 65e5c373ca2fa947a604a1e0ea35843c8c104658
parent 93e07bb34a825734d760971f811ac43868fd8c48
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 28 Oct 2025 21:12:08 +0100
make: Use a local signal variable
As the global stop variable is used in cleanup() we can be
caught by one signal when we enter in cleanup but stop can
be pointing to a different signal at the end of that function.
93e07bb34a825734d760971f811ac43868fd8c482025-10-28T20:10:31Z2025-10-28T20:10:31Zscc-make: Avoid signal race conditionsRoberto E. Vargas Caballerok0ga@shike2.netcommit 93e07bb34a825734d760971f811ac43868fd8c48
parent e19109cd35b8d64480c74389b8faaedf5af9b0ed
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 28 Oct 2025 21:10:31 +0100
scc-make: Avoid signal race conditions
Expecting ait to be interrupted by a signal is too risky
and it is very easy to be caught by race conditions. The
best option is to kill in the snal handler and lock signals
until we are ready to deal with them.
e19109cd35b8d64480c74389b8faaedf5af9b0ed2025-10-17T07:40:03Z2025-10-17T07:40:03Ztests/make: Increment timeout for 0102-signalRoberto E. Vargas Caballerok0ga@shike2.netcommit e19109cd35b8d64480c74389b8faaedf5af9b0ed
parent 6d9a517cf4c6b5133030b9744531340d22cef719
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 17 Oct 2025 09:40:03 +0200
tests/make: Increment timeout for 0102-signal
This tests shows to be a bit flaky. Increment the time
can help a bit.
6d9a517cf4c6b5133030b9744531340d22cef7192025-10-16T11:22:18Z2025-10-17T07:39:55Zbuild: Modify include pathRoberto E. Vargas Caballerok0ga@shike2.netcommit 6d9a517cf4c6b5133030b9744531340d22cef719
parent 6c3c992dc8f759f8c4052a4fb0d47d7681282664
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 16 Oct 2025 13:22:18 +0200
build: Modify include path
6c3c992dc8f759f8c4052a4fb0d47d76812826642025-08-05T12:00:25Z2025-08-05T12:00:25ZMerge remote-tracking branch 'origin/master'Roberto E. Vargas Caballerok0ga@shike2.netcommit 6c3c992dc8f759f8c4052a4fb0d47d7681282664
parent 23c081533234d616d3cc57e5794ee1b9f2a87b63
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 5 Aug 2025 14:00:25 +0200
Merge remote-tracking branch 'origin/master'
23c081533234d616d3cc57e5794ee1b9f2a87b632025-08-05T11:53:18Z2025-08-05T11:53:18Zmake: Make cleanup voidRoberto E. Vargas Caballerok0ga@shike2.netcommit 23c081533234d616d3cc57e5794ee1b9f2a87b63
parent 7d92f9f22004c00fca2fe52a183b8d8e1a1bca6f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 5 Aug 2025 13:53:18 +0200
make: Make cleanup void
It does not return any value ever, so it does not make sense to
have it like int, and it created problems porting it to plan9.
2a2e57ae043b6d78a5dbd50761971d65085407292025-06-17T18:16:23Z2025-06-17T19:05:29Zlibc/malloc: Unify malloc and reallocRoberto E. Vargas Caballerok0ga@shike2.netcommit 2a2e57ae043b6d78a5dbd50761971d6508540729
parent 2b33af36beceaf67507ab881f113d68a371a4f13
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 17 Jun 2025 20:16:23 +0200
libc/malloc: Unify malloc and realloc
realloc(p, 0) should behave like malloc(0), but we were not setting the
same errno values, and we were returning NULL in both cases, that makes
more difficult to differentiate the case when 0 is passed and the case
when we don't have enough memory. Given that the traditional behaviour
was always to return a pointer that could be freed (and even that was
the original behaviour in scc) this commit restores that behaviour.
2b33af36beceaf67507ab881f113d68a371a4f132025-06-17T19:04:13Z2025-06-17T19:05:29Ztests/make: Unset MAKEFLAGSRoberto E. Vargas Caballerok0ga@shike2.netcommit 2b33af36beceaf67507ab881f113d68a371a4f13
parent ac449d18a971e3e452e3f47cbd2af90b6a55ea18
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 17 Jun 2025 21:04:13 +0200
tests/make: Unset MAKEFLAGS
Some make implementations set MAKEFLAGS to non portable values
creating some problems when running the tests when we move from
the driven make to the make under test.
ac449d18a971e3e452e3f47cbd2af90b6a55ea182025-06-13T20:31:14Z2025-06-17T16:41:17Zscc-make: parseargv(): properly handle the -- argument, add test.Z. Gilboawriteonce@midipix.orgcommit ac449d18a971e3e452e3f47cbd2af90b6a55ea18
parent 30255fb57a7b5abf021e417aa34f380ae92bdbbe
Author: Z. Gilboa <writeonce@midipix.org>
Date: Fri, 13 Jun 2025 20:31:14 +0000
scc-make: parseargv(): properly handle the -- argument, add test.
30255fb57a7b5abf021e417aa34f380ae92bdbbe2025-06-14T07:42:49Z2025-06-17T07:48:14Z.gitignore: add missing entry for /src/cmd/scc-dump.Z. Gilboawriteonce@midipix.orgcommit 30255fb57a7b5abf021e417aa34f380ae92bdbbe
parent 63c66208e583d8538351428cb2d5bdf0aabe3e26
Author: Z. Gilboa <writeonce@midipix.org>
Date: Sat, 14 Jun 2025 07:42:49 +0000
.gitignore: add missing entry for /src/cmd/scc-dump.
63c66208e583d8538351428cb2d5bdf0aabe3e262025-06-04T14:36:22Z2025-06-04T14:36:22Zdriver/posix: Enable QBE for any arch/abiRoberto E. Vargas Caballerok0ga@shike2.netcommit 63c66208e583d8538351428cb2d5bdf0aabe3e26
parent 1f8f494a8504aa99052554476d86bcd0d6a7a1ba
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 4 Jun 2025 16:36:22 +0200
driver/posix: Enable QBE for any arch/abi
The validation for the correct combination of QBE, arch and abi
is done when the qbe target selection is done, so we don't have
to care about it when we select the scc backend used to generate
the QBE IL.
1f8f494a8504aa99052554476d86bcd0d6a7a1ba2025-06-04T14:31:49Z2025-06-04T14:31:49Zdriver/posix: Adjust qbe command line based in the targetRoberto E. Vargas Caballerok0ga@shike2.netcommit 1f8f494a8504aa99052554476d86bcd0d6a7a1ba
parent d853268357f02d13ca7377e2391b8ebb6290daad
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 4 Jun 2025 16:31:49 +0200
driver/posix: Adjust qbe command line based in the target
Qbe supports multiple ABIs and they are selected using the
command line flag -t.
d853268357f02d13ca7377e2391b8ebb6290daad2025-06-04T14:08:26Z2025-06-04T14:08:26Zcc2: Add support for qbe riscv64Roberto E. Vargas Caballerok0ga@shike2.netcommit d853268357f02d13ca7377e2391b8ebb6290daad
parent faf643c9afc0a74b276f24a8fdb4ba8552e351b3
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 4 Jun 2025 16:08:26 +0200
cc2: Add support for qbe riscv64
faf643c9afc0a74b276f24a8fdb4ba8552e351b32025-06-04T14:08:07Z2025-06-04T14:08:07Zcc2/arm64: Removed unused peep.cRoberto E. Vargas Caballerok0ga@shike2.netcommit faf643c9afc0a74b276f24a8fdb4ba8552e351b3
parent 06266207ce41e9fa1b7c2232b0a0243481287fd6
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 4 Jun 2025 16:08:07 +0200
cc2/arm64: Removed unused peep.c
This file was only a placeholder for the times when we built a
skeleton for arm64 without using qbe. As we don't build that
skeleton anymore, it does not make sense to keep this placeholder
anymore in the repository.
06266207ce41e9fa1b7c2232b0a0243481287fd62025-06-04T14:06:01Z2025-06-04T14:06:01Zcc1: Add support for riscv64Roberto E. Vargas Caballerok0ga@shike2.netcommit 06266207ce41e9fa1b7c2232b0a0243481287fd6
parent 7d92f9f22004c00fca2fe52a183b8d8e1a1bca6f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 4 Jun 2025 16:06:01 +0200
cc1: Add support for riscv64
7d92f9f22004c00fca2fe52a183b8d8e1a1bca6f2025-05-27T18:19:30Z2025-05-27T18:19:30Zbuild: Remove redundant make buildRoberto E. Vargas Caballerok0ga@shike2.netcommit 7d92f9f22004c00fca2fe52a183b8d8e1a1bca6f
parent 6182ec6e314de95182742064f5bb2d80abf11c8c
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 27 May 2025 20:19:30 +0200
build: Remove redundant make build
Scc-make was already built before this rule began its execution.
6182ec6e314de95182742064f5bb2d80abf11c8c2025-05-24T04:54:25Z2025-05-24T04:57:54Zlibc/vfprintf: Adjust variable typesRoberto E. Vargas Caballerok0ga@shike2.netcommit 6182ec6e314de95182742064f5bb2d80abf11c8c
parent 9c55c9b38fb53863c83f8d59ea6241682b2ea463
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 24 May 2025 06:54:25 +0200
libc/vfprintf: Adjust variable types
9c55c9b38fb53863c83f8d59ea6241682b2ea4632025-05-13T08:14:24Z2025-05-13T08:14:24Zdoc: Clarify how to use muslRoberto E. Vargas Caballerok0ga@shike2.netcommit 9c55c9b38fb53863c83f8d59ea6241682b2ea463
parent 5900420c8566844b1e379dc62adb0467142f56d6
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 13 May 2025 10:14:24 +0200
doc: Clarify how to use musl
5900420c8566844b1e379dc62adb0467142f56d62025-05-12T20:28:28Z2025-05-12T20:28:28Zbuild: Use SCCMAKE instead of SMAKERoberto E. Vargas Caballerok0ga@shike2.netcommit 5900420c8566844b1e379dc62adb0467142f56d6
parent 1f6bfcd9114a69b495191dbc3d96c27e1468a8f9
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 12 May 2025 22:28:28 +0200
build: Use SCCMAKE instead of SMAKE
It makes more clear what the macro is intended and it makes
easier to override it to use some other make in case of being
needed (for example to get parallel builds).
1f6bfcd9114a69b495191dbc3d96c27e1468a8f92025-05-11T18:31:23Z2025-05-12T10:01:57Ztest/cc: Add 0231-init.cRoberto E. Vargas Caballerok0ga@shike2.netcommit 1f6bfcd9114a69b495191dbc3d96c27e1468a8f9
parent dfbe125c3b0d001a9f0d671c6adfdb41e488e8cf
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 11 May 2025 20:31:23 +0200
test/cc: Add 0231-init.c
dfbe125c3b0d001a9f0d671c6adfdb41e488e8cf2025-04-28T08:55:23Z2025-04-28T08:55:23Zcc1: Allow struct assigments in initializationRoberto E. Vargas Caballerok0ga@shike2.netcommit dfbe125c3b0d001a9f0d671c6adfdb41e488e8cf
parent 11236c88e689f884619332bedbffd3501916f887
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 28 Apr 2025 10:55:23 +0200
cc1: Allow struct assigments in initialization
Currently, the code was only supporting initializers for struct
but it should support also arbitrary expressions emitting
the correct assignment statement.
11236c88e689f884619332bedbffd3501916f8872025-04-25T08:27:33Z2025-04-25T08:27:33Zcc1: Initialize correctly unionsXavier Del Campo Romeroxavi92@disroot.orgcommit 11236c88e689f884619332bedbffd3501916f887
parent 2c35688619f6c5804106dfe52ee199894eb6b056
Author: Xavier Del Campo Romero <xavi92@disroot.org>
Date: Fri, 25 Apr 2025 10:27:33 +0200
cc1: Initialize correctly unions
When an union has an initializer then it initializes the first
member of the union unless a designated initializer is used.
The code was not ready to initialize an union with an implicit
value.
2c35688619f6c5804106dfe52ee199894eb6b0562025-04-25T07:22:59Z2025-04-25T07:22:59Zbuild: Bootstrap scc using scc-makeRoberto E. Vargas Caballerok0ga@shike2.netcommit 2c35688619f6c5804106dfe52ee199894eb6b056
parent d0ec99aaad5f303dfbd9fd0e094856f7f78c106d
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 25 Apr 2025 09:22:59 +0200
build: Bootstrap scc using scc-make
Some problems were found with some make implementations, and as
scc includes its own make version, it is a problem that we can
easily avoid just using the make from the repo.
d0ec99aaad5f303dfbd9fd0e094856f7f78c106d2025-04-21T20:08:39Z2025-04-21T20:30:29Zlibc: Add macro definition for setjmpRoberto E. Vargas Caballerok0ga@shike2.netcommit d0ec99aaad5f303dfbd9fd0e094856f7f78c106d
parent 26962956798171998310076e26dd086187ea5ba9
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 21 Apr 2025 22:08:39 +0200
libc: Add macro definition for setjmp
The standard is contradictory about setjmp(), because it literally says
that it can be a macro or a function, but it has several paragrapshs
where it defines it as a macro, and even explicitely says that setjmp.h
defines the setjmp macro. Given this situation, the saner decision is to
define it as a recursive macro with one argument that expands to itself.
26962956798171998310076e26dd086187ea5ba92025-04-18T21:40:57Z2025-04-19T07:11:18Zbuild: Remove lorderRoberto E. Vargas Caballerok0ga@shike2.netcommit 26962956798171998310076e26dd086187ea5ba9
parent 027d5ed74d0e1195669b4f7d7a1531a82f3441e0
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 18 Apr 2025 23:40:57 +0200
build: Remove lorder
It is not used anymore, and it required to include the caldera
license.
027d5ed74d0e1195669b4f7d7a1531a82f3441e02025-04-18T20:55:07Z2025-04-18T20:55:07ZMerge remote-tracking branch 'origin/master'Roberto E. Vargas Caballerok0ga@shike2.netcommit 027d5ed74d0e1195669b4f7d7a1531a82f3441e0
parent 23beeedce6a5a56ce4a12dbb96178fc165e913b4
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 18 Apr 2025 22:55:07 +0200
Merge remote-tracking branch 'origin/master'
23beeedce6a5a56ce4a12dbb96178fc165e913b42025-04-18T20:52:50Z2025-04-18T20:52:50Zdoc: Unify license informationRoberto E. Vargas Caballerok0ga@shike2.netcommit 23beeedce6a5a56ce4a12dbb96178fc165e913b4
parent 473b289e3176157e7674cf676ec1ef56a8c04e02
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 18 Apr 2025 22:52:50 +0200
doc: Unify license information
64470722a2a80a6b9144a79a162e11e8a0c2b7fb2025-04-09T15:15:48Z2025-04-12T09:58:24ZFix double free in swtch.cremphlhr@disroot.orgcommit 64470722a2a80a6b9144a79a162e11e8a0c2b7fb
parent d5d0d662f6a48cf922d524b0df11911bde263fac
Author: remph <lhr@disroot.org>
Date: Wed, 9 Apr 2025 16:15:48 +0100
Fix double free in swtch.c
The `list' pointer should be reset to NULL after the memory it points to
has been freed, otherwise the next time cleanswtch() is called it iterates
over the list starting at freed memory.
d5d0d662f6a48cf922d524b0df11911bde263fac2025-04-09T15:10:00Z2025-04-12T09:47:43Ztests/libc: Fix wchar testslhr@disroot.orglhr@disroot.orgcommit d5d0d662f6a48cf922d524b0df11911bde263fac
parent 473b289e3176157e7674cf676ec1ef56a8c04e02
Author: lhr@disroot.org <lhr@disroot.org>
Date: Wed, 9 Apr 2025 16:10:00 +0100
tests/libc: Fix wchar tests
473b289e3176157e7674cf676ec1ef56a8c04e022025-04-07T13:17:39Z2025-04-07T13:17:39Zlibc/openbsd: fix int_fast64_t definitionLucas Gabriel Vuottolucas@lgv5.netcommit 473b289e3176157e7674cf676ec1ef56a8c04e02
parent 1127a487c737f972f98aeb54bd29e599e5c6af85
Author: Lucas Gabriel Vuotto <lucas@lgv5.net>
Date: Mon, 7 Apr 2025 15:17:39 +0200
libc/openbsd: fix int_fast64_t definition
1127a487c737f972f98aeb54bd29e599e5c6af852025-04-02T07:42:19Z2025-04-02T07:42:19Ztests/libc: Remove errno checkRoberto E. Vargas Caballerok0ga@shike2.netcommit 1127a487c737f972f98aeb54bd29e599e5c6af85
parent a6e12fcc40f07b3e465dba61249f86e1b2b25d38
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 2 Apr 2025 09:42:19 +0200
tests/libc: Remove errno check
Mbstowcs() and Wctomb() are not supposed to set errno, or at
least is not required by the specification.
a6e12fcc40f07b3e465dba61249f86e1b2b25d382025-03-28T11:49:17Z2025-03-28T11:49:17Zlibc/wchar: Remove useless state in wc*Roberto E. Vargas Caballerok0ga@shike2.netcommit a6e12fcc40f07b3e465dba61249f86e1b2b25d38
parent 68ad37c9bee5f12c0804f165a5176e4bbf4b4898
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 28 Mar 2025 12:49:17 +0100
libc/wchar: Remove useless state in wc*
We don't use state in conversions from wchar to mb, so
it is useless to have static variables that don't mean
anything.
68ad37c9bee5f12c0804f165a5176e4bbf4b48982025-03-28T08:42:13Z2025-03-28T08:42:13Zlibc/wchar: Simplify mbsrtowc() and mbstowc()Roberto E. Vargas Caballerok0ga@shike2.netcommit 68ad37c9bee5f12c0804f165a5176e4bbf4b4898
parent 29f51dd9ea6407ff5d6386d7dc82cd499185533e
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 28 Mar 2025 09:42:13 +0100
libc/wchar: Simplify mbsrtowc() and mbstowc()
We only support UTF8, that is stateless, and as mbsrtowc() cannot return
-2 then we do know that the internal state of mbsrtowc() will be always
set to the initial state, so we can reuse it from mbstowcs().
Also, mbsrtowcs() had a bug and it was incrementing the number of wchar
stored in the output buffer when mbrtowc() returned -2. Not a big issue
because we try to read MB_LEN_MAX, and longer sequences will eventually
return -1 and the value of n will not be used.
29f51dd9ea6407ff5d6386d7dc82cd499185533e2025-03-27T21:11:35Z2025-03-27T21:11:35Zlibc/wchar: Remove state from mbtowc()Roberto E. Vargas Caballerok0ga@shike2.netcommit 29f51dd9ea6407ff5d6386d7dc82cd499185533e
parent 115f7694ce1502f57bb72b9e34d8816c5224e843
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 27 Mar 2025 22:11:35 +0100
libc/wchar: Remove state from mbtowc()
As we only support utf8 it does not make sense to keep state in mbtowc()
because as we cannot differentiate between an incorrect sequence and
a non complete sequence then there is not actual use case for that
state. We still keep the static variable because we don't want to use
the internal state from mbrtowc(), and as this function is not safe
thread anyway it is not a problem to have that variable, whose value
will be always correct, except when mbrtowc() returns -2 and in that
case we have to clear it.
The C99 specification does not specify any errno value when mbtowc()
fails, but it allows changes to errno even when it is not directly
specified in the standard, so it is not a problem to implement
mbtowc() using mbrtowc() which sets errno when it cannot translate
a full multibyte sequence.
115f7694ce1502f57bb72b9e34d8816c5224e8432025-03-27T12:09:21Z2025-03-27T14:39:20Ztests/cc: Reuse 0193-incompleteRoberto E. Vargas Caballerok0ga@shike2.netcommit 115f7694ce1502f57bb72b9e34d8816c5224e843
parent 0cc26f9abb8c7f8a5ad30563d63bda35a5345322
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 27 Mar 2025 13:09:21 +0100
tests/cc: Reuse 0193-incomplete
This test was a copy of 0180-imcomplete, and the issue [i]
stated that using an incomplete array type as parameter of
a function is UB. In our case we accept it, but it makes
more sense to give an error in that case. Rework in 0180
is expected. This test is reused to check that an extern
struct can be declared with incomplete type.
[i] https://www.open-std.org/jtc1/sc22/wg14/issues/c90/issue0047.html
0cc26f9abb8c7f8a5ad30563d63bda35a53453222025-03-26T13:46:30Z2025-03-26T13:46:30Zlibc/wchar: Add wcspbrk()Roberto E. Vargas Caballerok0ga@shike2.netcommit 0cc26f9abb8c7f8a5ad30563d63bda35a5345322
parent 281fd80448d875367f4be096a00ebbc847a06c1b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 26 Mar 2025 14:46:30 +0100
libc/wchar: Add wcspbrk()
281fd80448d875367f4be096a00ebbc847a06c1b2025-03-26T13:41:30Z2025-03-26T13:41:30Zlibc/string: Simplify strpbrk()Roberto E. Vargas Caballerok0ga@shike2.netcommit 281fd80448d875367f4be096a00ebbc847a06c1b
parent 5a4639f2e13052cfd4ff099cf1fcee020af58a55
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 26 Mar 2025 14:41:30 +0100
libc/string: Simplify strpbrk()
Strpbrk() is trivial if strcspn() is used.
5a4639f2e13052cfd4ff099cf1fcee020af58a552025-03-26T13:34:58Z2025-03-26T13:34:58Zlibc/wchar: Add wcscspn()Roberto E. Vargas Caballerok0ga@shike2.netcommit 5a4639f2e13052cfd4ff099cf1fcee020af58a55
parent d21aa5a5a185cacd7a63439788287ef6564ad5e2
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 26 Mar 2025 14:34:58 +0100
libc/wchar: Add wcscspn()
d21aa5a5a185cacd7a63439788287ef6564ad5e22025-03-26T13:26:21Z2025-03-26T13:29:56Zlibc/wchar: Add wcsspn()Roberto E. Vargas Caballerok0ga@shike2.netcommit d21aa5a5a185cacd7a63439788287ef6564ad5e2
parent aef615310c0729e97e4ad5a2e4206266660679a2
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 26 Mar 2025 14:26:21 +0100
libc/wchar: Add wcsspn()
aef615310c0729e97e4ad5a2e4206266660679a22025-03-26T13:14:28Z2025-03-26T13:14:28Zlibc/wchar: Add wcsxfrm()Roberto E. Vargas Caballerok0ga@shike2.netcommit aef615310c0729e97e4ad5a2e4206266660679a2
parent 09245abd272928c778c739e2402517a464b1a678
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 26 Mar 2025 14:14:28 +0100
libc/wchar: Add wcsxfrm()
09245abd272928c778c739e2402517a464b1a6782025-03-25T20:44:30Z2025-03-25T20:44:30Zlibc/wchar: Add wcsstr()Roberto E. Vargas Caballerok0ga@shike2.netcommit 09245abd272928c778c739e2402517a464b1a678
parent 1b9b9b8ada90d264546916bc65e2867ba3a0fca3
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 21:44:30 +0100
libc/wchar: Add wcsstr()
1b9b9b8ada90d264546916bc65e2867ba3a0fca32025-03-25T20:32:52Z2025-03-25T20:39:12Zlibc/wchar: Add wcsrchr()Roberto E. Vargas Caballerok0ga@shike2.netcommit 1b9b9b8ada90d264546916bc65e2867ba3a0fca3
parent 8a6918d48bb8ecbc1c2af2c72b2e89a3df3a999b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 21:32:52 +0100
libc/wchar: Add wcsrchr()
8a6918d48bb8ecbc1c2af2c72b2e89a3df3a999b2025-03-25T20:26:58Z2025-03-25T20:26:58Zlibc/wchar: Add wcschr()Roberto E. Vargas Caballerok0ga@shike2.netcommit 8a6918d48bb8ecbc1c2af2c72b2e89a3df3a999b
parent 4ac2c9373b1004d4176807d0b106c97cbdab8163
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 21:26:58 +0100
libc/wchar: Add wcschr()
4ac2c9373b1004d4176807d0b106c97cbdab81632025-03-25T19:56:32Z2025-03-25T20:14:20Zlibc/wchar: Add wcsncat()Roberto E. Vargas Caballerok0ga@shike2.netcommit 4ac2c9373b1004d4176807d0b106c97cbdab8163
parent 949d7de20391cbcb0a6ce10cf2080abb7914b6b5
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 20:56:32 +0100
libc/wchar: Add wcsncat()
949d7de20391cbcb0a6ce10cf2080abb7914b6b52025-03-25T19:50:32Z2025-03-25T19:55:37Zlibc/wchar: Add wcscat()Roberto E. Vargas Caballerok0ga@shike2.netcommit 949d7de20391cbcb0a6ce10cf2080abb7914b6b5
parent 7aa86bd1b38fb9ddd568ed8c13f534a274f50fbb
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 20:50:32 +0100
libc/wchar: Add wcscat()
7aa86bd1b38fb9ddd568ed8c13f534a274f50fbb2025-03-25T19:34:38Z2025-03-25T19:34:38Zlibc/wchar: Add wcsncpy()Roberto E. Vargas Caballerok0ga@shike2.netcommit 7aa86bd1b38fb9ddd568ed8c13f534a274f50fbb
parent 7dcb0d9d9eee6306f01cf4788b8eef1fa9baa9c7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 20:34:38 +0100
libc/wchar: Add wcsncpy()
7dcb0d9d9eee6306f01cf4788b8eef1fa9baa9c72025-03-25T18:49:46Z2025-03-25T18:49:46Zlibc/wchar: Add wmemset()Roberto E. Vargas Caballerok0ga@shike2.netcommit 7dcb0d9d9eee6306f01cf4788b8eef1fa9baa9c7
parent d7543e2d9e5bc064ac6f1b2469511aae17f0ad52
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 19:49:46 +0100
libc/wchar: Add wmemset()
d7543e2d9e5bc064ac6f1b2469511aae17f0ad522025-03-25T18:35:22Z2025-03-25T18:39:26Ztests/wchar: Add wmemmove()Roberto E. Vargas Caballerok0ga@shike2.netcommit d7543e2d9e5bc064ac6f1b2469511aae17f0ad52
parent 32c148f21e31e4db0d6f05298c8f5b2d2ad7d9c1
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 19:35:22 +0100
tests/wchar: Add wmemmove()
32c148f21e31e4db0d6f05298c8f5b2d2ad7d9c12025-03-25T18:15:00Z2025-03-25T18:39:26Zlibc/wchar: Add wmemcmp()Roberto E. Vargas Caballerok0ga@shike2.netcommit 32c148f21e31e4db0d6f05298c8f5b2d2ad7d9c1
parent f82bc6684d7c33065ce616b79528e7a0e439d1df
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 19:15:00 +0100
libc/wchar: Add wmemcmp()
f82bc6684d7c33065ce616b79528e7a0e439d1df2025-03-25T18:03:27Z2025-03-25T18:39:26Zlibc/wchar: Add wmemcpy()Roberto E. Vargas Caballerok0ga@shike2.netcommit f82bc6684d7c33065ce616b79528e7a0e439d1df
parent 391c2dacb748852e77bfe811556b145ecdda684b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 19:03:27 +0100
libc/wchar: Add wmemcpy()
391c2dacb748852e77bfe811556b145ecdda684b2025-03-25T17:36:39Z2025-03-25T17:36:39Zlibc/string: Improve memchr()Roberto E. Vargas Caballerok0ga@shike2.netcommit 391c2dacb748852e77bfe811556b145ecdda684b
parent bbb33960d11eacc45a1ea00d60bf46a39ae9693b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 18:36:39 +0100
libc/string: Improve memchr()
No need to increment something to decrement it later.
bbb33960d11eacc45a1ea00d60bf46a39ae9693b2025-03-25T17:30:34Z2025-03-25T17:30:34Zlibc/wchar: Add wmemchr()Roberto E. Vargas Caballerok0ga@shike2.netcommit bbb33960d11eacc45a1ea00d60bf46a39ae9693b
parent 3b42911841f616a37e3fa7bd5f4ad7177ce959cf
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 18:30:34 +0100
libc/wchar: Add wmemchr()
3b42911841f616a37e3fa7bd5f4ad7177ce959cf2025-03-25T09:52:47Z2025-03-25T09:52:47ZMerge remote-tracking branch 'origin/master' into wcharRoberto E. Vargas Caballerok0ga@shike2.comcommit 3b42911841f616a37e3fa7bd5f4ad7177ce959cf
parent b96ef460770e7d0bf335cbadbed7efd2db08199e
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 25 Mar 2025 10:52:47 +0100
Merge remote-tracking branch 'origin/master' into wchar
b96ef460770e7d0bf335cbadbed7efd2db08199e2025-03-25T09:50:48Z2025-03-25T09:50:48Zlibc/stdio: Remove unneeded initializationRoberto E. Vargas Caballerok0ga@shike2.comcommit b96ef460770e7d0bf335cbadbed7efd2db08199e
parent f507bae3a0e45b6f9eeadecb3065afaea1a6d6bc
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 25 Mar 2025 10:50:48 +0100
libc/stdio: Remove unneeded initialization
The cnt variable is later initialized in the for loop.
8a18b4fd343760cf387e59ca9d27ffc2ef9b1ffa2025-03-25T07:21:50Z2025-03-25T07:21:50Ztests/libc: Add a new invalid utf-8 test caseRoberto E. Vargas Caballerok0ga@shike2.netcommit 8a18b4fd343760cf387e59ca9d27ffc2ef9b1ffa
parent 94d009f0d25f0426186fe0f209abc1f229c47d12
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 25 Mar 2025 08:21:50 +0100
tests/libc: Add a new invalid utf-8 test case
This test case test a overlong encoding for the character 'A'. While
we were testing overlong encodings, we were using some special cases
like the NUL character, and having a more normal ASCII case covers
some additional paths in the code.
94d009f0d25f0426186fe0f209abc1f229c47d122025-03-24T08:54:26Z2025-03-24T08:54:26Zlibc/wchar: Add wcscpy()Roberto E. Vargas Caballerok0ga@shike2.netcommit 94d009f0d25f0426186fe0f209abc1f229c47d12
parent c5af9fc33eda2506eebc629d07a09e637e3311f2
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 24 Mar 2025 09:54:26 +0100
libc/wchar: Add wcscpy()
c5af9fc33eda2506eebc629d07a09e637e3311f22025-03-22T09:32:25Z2025-03-22T09:32:25Zlibc/stdlib: Use state in mbstowcs and wcstombsRoberto E. Vargas Caballerok0ga@shike2.netcommit c5af9fc33eda2506eebc629d07a09e637e3311f2
parent 32ebae08d603f27be737d19728d48f2a9859de50
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 22 Mar 2025 10:32:25 +0100
libc/stdlib: Use state in mbstowcs and wcstombs
These functions should behave as if mbrstowcs() and wcsrtombs() were not
called, and for that reason they need their own internal state instead
of using the state from them.
32ebae08d603f27be737d19728d48f2a9859de502025-03-22T09:27:54Z2025-03-22T09:30:39Zlibc/wchar: Add wcscoll()Roberto E. Vargas Caballerok0ga@shike2.netcommit 32ebae08d603f27be737d19728d48f2a9859de50
parent 36606c7df70f2465a4305395c529e7ea1add693f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 22 Mar 2025 10:27:54 +0100
libc/wchar: Add wcscoll()
36606c7df70f2465a4305395c529e7ea1add693f2025-03-21T18:23:17Z2025-03-21T18:23:17Ztests/libc: Add 0042-mbsrtowcRoberto E. Vargas Caballerok0ga@shike2.netcommit 36606c7df70f2465a4305395c529e7ea1add693f
parent 01921365fc084e3b592c00bdd090d0d457502904
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 21 Mar 2025 19:23:17 +0100
tests/libc: Add 0042-mbsrtowc
01921365fc084e3b592c00bdd090d0d4575029042025-03-21T18:21:44Z2025-03-21T18:21:44Zlibc/wchar: Add wcsncmp()Roberto E. Vargas Caballerok0ga@shike2.netcommit 01921365fc084e3b592c00bdd090d0d457502904
parent e5399b363bcd8af06edc6bb4ba9edb034bcbe728
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 21 Mar 2025 19:21:44 +0100
libc/wchar: Add wcsncmp()
e5399b363bcd8af06edc6bb4ba9edb034bcbe7282025-03-21T10:43:34Z2025-03-21T10:43:34Ztests/libc: Add 0045-wcscmpRoberto E. Vargas Caballerok0ga@shike2.netcommit e5399b363bcd8af06edc6bb4ba9edb034bcbe728
parent e74078b4eed9b2365e67d58f97d2964bec425aac
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 21 Mar 2025 11:43:34 +0100
tests/libc: Add 0045-wcscmp
e74078b4eed9b2365e67d58f97d2964bec425aac2025-03-21T10:42:59Z2025-03-21T10:42:59Zlibc/wchar: Add wcscmp()Roberto E. Vargas Caballerok0ga@shike2.netcommit e74078b4eed9b2365e67d58f97d2964bec425aac
parent d55ef47946e20f9acb7601cb3c05247056c802e4
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 21 Mar 2025 11:42:59 +0100
libc/wchar: Add wcscmp()
d55ef47946e20f9acb7601cb3c05247056c802e42025-03-21T10:41:53Z2025-03-21T10:41:53Zlibc/string: Simplify strcmpRoberto E. Vargas Caballerok0ga@shike2.netcommit d55ef47946e20f9acb7601cb3c05247056c802e4
parent 3f16edee3f63d37bcd7f41aec82daec377faf09f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 21 Mar 2025 11:41:53 +0100
libc/string: Simplify strcmp
3f16edee3f63d37bcd7f41aec82daec377faf09f2025-03-21T10:21:51Z2025-03-21T10:21:51Zlibc/wchar: Group mem and str functionsRoberto E. Vargas Caballerok0ga@shike2.netcommit 3f16edee3f63d37bcd7f41aec82daec377faf09f
parent e9db6f680a03e9d71d1b4091560599c84448cd39
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 21 Mar 2025 11:21:51 +0100
libc/wchar: Group mem and str functions
This separation makes easier to know what functions are implemented and
what functions are not implemented.
e9db6f680a03e9d71d1b4091560599c84448cd392025-03-21T10:20:42Z2025-03-21T10:20:42Ztests/libc: Add 0044-wcslen testRoberto E. Vargas Caballerok0ga@shike2.netcommit e9db6f680a03e9d71d1b4091560599c84448cd39
parent 0827b4938a966940d42e0382c4fd16d325110c8d
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 21 Mar 2025 11:20:42 +0100
tests/libc: Add 0044-wcslen test
0827b4938a966940d42e0382c4fd16d325110c8d2025-03-21T08:14:06Z2025-03-21T08:14:06Zlibc/wchar: Group single wchar I/O functionsRoberto E. Vargas Caballerok0ga@shike2.netcommit 0827b4938a966940d42e0382c4fd16d325110c8d
parent e7d90888786b65dee9fec9deb9c880857d6e4d8c
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 21 Mar 2025 09:14:06 +0100
libc/wchar: Group single wchar I/O functions
This makes easier to know the functions that still has to be implemented
and makes easier to know the not implemented functions. It also adds the
macro definition for getwc(). The macro definitions for getwchar() and
for putwchar() were considered, but as they required a definition of the
stdin or stdout macros (or the full defition of FILE to have access to
the __iob array) it was considered worthless and they will just have the
function library definition.
e7d90888786b65dee9fec9deb9c880857d6e4d8c2025-03-21T07:51:48Z2025-03-21T07:51:48Ztests/libc: Add 0041-mbrlen to .gitignoreRoberto E. Vargas Caballerok0ga@shike2.netcommit e7d90888786b65dee9fec9deb9c880857d6e4d8c
parent 8b488b39369013d53b7fea4419f213e7b04a6604
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 21 Mar 2025 08:51:48 +0100
tests/libc: Add 0041-mbrlen to .gitignore
8b488b39369013d53b7fea4419f213e7b04a66042025-03-20T21:29:25Z2025-03-20T21:29:25Zlibc/wchar: Remove macros for mblen and mbrlenRoberto E. Vargas Caballerok0ga@shike2.netcommit 8b488b39369013d53b7fea4419f213e7b04a6604
parent a378af318684a868015e1efa73b14ab525d3ac27
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 20 Mar 2025 22:29:25 +0100
libc/wchar: Remove macros for mblen and mbrlen
These macros were using the hidden state from mbrtowc() that violates
the constraint of the standard that specifies that the libc should
behave as mbrtowc() is not called internally by the own libc.
a378af318684a868015e1efa73b14ab525d3ac272025-03-20T19:28:37Z2025-03-20T19:35:12Ztests/libc: Add 0041-mbrlen()Roberto E. Vargas Caballerok0ga@shike2.netcommit a378af318684a868015e1efa73b14ab525d3ac27
parent c675740de75457783b309d357f586a768cf31fed
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 20 Mar 2025 20:28:37 +0100
tests/libc: Add 0041-mbrlen()
c675740de75457783b309d357f586a768cf31fed2025-03-20T19:23:33Z2025-03-20T19:35:12Zlibc/stdlib: Use internal state in wctomb()Roberto E. Vargas Caballerok0ga@shike2.netcommit c675740de75457783b309d357f586a768cf31fed
parent 6f13ed360e15b5daa1df2c2de39dc93422db4255
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 20 Mar 2025 20:23:33 +0100
libc/stdlib: Use internal state in wctomb()
Wctomb() must behave as if the function wcrtomb() is not called (in
other words, it should not use the internal hidden state of wcrtomb())
and for that reason its own static mbstate_t variable.
6f13ed360e15b5daa1df2c2de39dc93422db42552025-03-20T19:07:17Z2025-03-20T19:35:12Zlibc/wchar: Use hidden state in mblen and mbrlenRoberto E. Vargas Caballerok0ga@shike2.netcommit 6f13ed360e15b5daa1df2c2de39dc93422db4255
parent abc7bb9f69d648be0457170d1f491594cbb2f7e7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 20 Mar 2025 20:07:17 +0100
libc/wchar: Use hidden state in mblen and mbrlen
These functions have a hidden state and they should
behave as if they don't call mbrtowc (not using the
internal hidden state of mbrtowc) and the return value
of mblen() has to be adjusted because it cannot
return -2 in the same way that mbrtowc() does.
abc7bb9f69d648be0457170d1f491594cbb2f7e72025-03-20T16:05:17Z2025-03-20T16:05:17Ztests/libc: Add 0040-wcrtombRoberto E. Vargas Caballerok0ga@shike2.netcommit abc7bb9f69d648be0457170d1f491594cbb2f7e7
parent 94afd0b6e12799c59effe955f41b3aaf53003ed7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 20 Mar 2025 17:05:17 +0100
tests/libc: Add 0040-wcrtomb
94afd0b6e12799c59effe955f41b3aaf53003ed72025-03-20T16:01:44Z2025-03-20T16:01:44Zlibc/wchar: Fix unicode rangeRoberto E. Vargas Caballerok0ga@shike2.netcommit 94afd0b6e12799c59effe955f41b3aaf53003ed7
parent d0c96fd6db74dca3d53aca43116de9597c43944b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 20 Mar 2025 17:01:44 +0100
libc/wchar: Fix unicode range
Unicode codepoints are defined to be smaller than 0x110000, but
the table missed a 0, defining wrongly the last invalid range.
d0c96fd6db74dca3d53aca43116de9597c43944b2025-03-20T09:58:51Z2025-03-20T09:58:51Zmake: Add more debug outputRoberto E. Vargas Caballerok0ga@shike2.netcommit d0c96fd6db74dca3d53aca43116de9597c43944b
parent d66da367d6d4052bdcea205b600c84fa30de2bd2
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 20 Mar 2025 10:58:51 +0100
make: Add more debug output
d66da367d6d4052bdcea205b600c84fa30de2bd22025-03-17T16:26:12Z2025-03-17T16:26:12Ztests/make: Add 0107-inferenceRoberto E. Vargas Caballerok0ga@shike2.comcommit d66da367d6d4052bdcea205b600c84fa30de2bd2
parent 61c6638246049b2085f1ef70e5b478c088d1f7da
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Mon, 17 Mar 2025 17:26:12 +0100
tests/make: Add 0107-inference
61c6638246049b2085f1ef70e5b478c088d1f7da2025-03-17T15:58:03Z2025-03-17T15:58:03Zmake: Check target name in dependenciesRoberto E. Vargas Caballerok0ga@shike2.comcommit 61c6638246049b2085f1ef70e5b478c088d1f7da
parent 5bc57804faae91164edcd9f3aec054da4825b423
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Mon, 17 Mar 2025 16:58:03 +0100
make: Check target name in dependencies
A target can have (and usually they have) dependencies with
other files, so we cannot assume that if we have a dependency
with build actions then we have a rule that is able to build
the target, because the build actions can be for other target.