scc, branch HEADsimple c99 compiler
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.
5bc57804faae91164edcd9f3aec054da4825b4232025-03-11T13:28:07Z2025-03-11T16:33:14Ztests/libc: Add 0039-mbrtowcRoberto E. Vargas Caballerok0ga@shike2.comcommit 5bc57804faae91164edcd9f3aec054da4825b423
parent 1136d831017b0b7052b45899d08093d8f4034ce8
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 11 Mar 2025 14:28:07 +0100
tests/libc: Add 0039-mbrtowc
1136d831017b0b7052b45899d08093d8f4034ce82025-03-11T13:25:06Z2025-03-11T13:25:06Ztests/libc: Add 0038-mbsinitRoberto E. Vargas Caballerok0ga@shike2.comcommit 1136d831017b0b7052b45899d08093d8f4034ce8
parent b4b507633186e7f223231a60447d82a6e3ab92af
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 11 Mar 2025 14:25:06 +0100
tests/libc: Add 0038-mbsinit
b4b507633186e7f223231a60447d82a6e3ab92af2025-03-10T20:22:52Z2025-03-11T12:06:07Zlibc/wchar: Rewrite mbtowc()Roberto E. Vargas Caballerok0ga@shike2.comcommit b4b507633186e7f223231a60447d82a6e3ab92af
parent f507bae3a0e45b6f9eeadecb3065afaea1a6d6bc
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Mon, 10 Mar 2025 21:22:52 +0100
libc/wchar: Rewrite mbtowc()
There are many different corner cases in the implementation of the
underlaying call to mbrtowc(). When mbrtowc() returns -2, it should
be ready to receive new bytes with new calls, and it requires to update
the conversion state.
Also, the standard specifies:
The implementation shall behave as if no library function calls
the mbtowc function.
and for that reason, we cannot pass a NULL pointer as state to mbrtowc()
because it would imply to use the hidden state of mbrtowc().
After considering to keep ABI compatibility with the definiton of mbstate_t
in the different systems, it created to many problems. There is 0 guarantees
that code compiled with different libc implementations would work, and for
that reason we dropped the ABI compatibility.
f507bae3a0e45b6f9eeadecb3065afaea1a6d6bc2025-02-22T12:14:54Z2025-03-10T13:14:15Zmake/posix: Fix feature test macrosremphlhr@disroot.orgcommit f507bae3a0e45b6f9eeadecb3065afaea1a6d6bc
parent dee0c6f0c90f7d64fd45cb6e3c48321f4beaf81d
Author: remph <lhr@disroot.org>
Date: Sat, 22 Feb 2025 13:14:54 +0100
make/posix: Fix feature test macros
_POSIX_C_SOURCE must be defined with a value that signals what
version of POSIX has to be exposed, and just defining it without
any value is equivalent to define it with 0 that is not a valid
version number.
In the same way, posix.c was using S_IFDIR that is XSI, and
to increase the portability it was changed to S_ISDIR that
is defined in the base specification.
dee0c6f0c90f7d64fd45cb6e3c48321f4beaf81d2025-02-26T09:31:51Z2025-03-10T13:13:41Zlibc/wchar: Fix unicode handlingRoberto E. Vargas Caballerok0ga@shike2.comcommit dee0c6f0c90f7d64fd45cb6e3c48321f4beaf81d
parent 2eaef0900f5ebd9f00bebd8ce899423a0b37b4bb
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 26 Feb 2025 10:31:51 +0100
libc/wchar: Fix unicode handling
* mbrtowc: validate input, handle 4-byte UTF-8 code points, set errno
* wcrtomb: if a UTF-8 sequence has N bytes, the leading byte has the first
N bits set (with ASCII characters a special case), not the first N-1 bits
* _validutf8: negate condition
2eaef0900f5ebd9f00bebd8ce899423a0b37b4bb2025-02-22T12:14:53Z2025-03-10T13:09:32Zlibc/tests: add omitted headersremphlhr@disroot.orgcommit 2eaef0900f5ebd9f00bebd8ce899423a0b37b4bb
parent 7033385eda09474ab9a8e21ae811d916e3856ce6
Author: remph <lhr@disroot.org>
Date: Sat, 22 Feb 2025 13:14:53 +0100
libc/tests: add omitted headers
7033385eda09474ab9a8e21ae811d916e3856ce62025-03-10T12:57:08Z2025-03-10T13:03:22Zlibc: Add get/set for mbstate_tRoberto E. Vargas Caballerok0ga@shike2.comcommit 7033385eda09474ab9a8e21ae811d916e3856ce6
parent b454c47b530863e732c6100728d35e8e663d3a5d
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Mon, 10 Mar 2025 13:57:08 +0100
libc: Add get/set for mbstate_t
The definition of mbstate_t depends of the system, and for that reason
we cannot access directly the content of the data type. To solve this
problem different system functions were added making the generic code
portable between the different implementations.
b454c47b530863e732c6100728d35e8e663d3a5d2025-03-08T18:03:55Z2025-03-10T10:06:01Zmkdep: Fix backslash escapesQuentin Rameauquinq@fifth.spacecommit b454c47b530863e732c6100728d35e8e663d3a5d
parent 760c60d60ed363c83c22512e35a451544aaa44b7
Author: Quentin Rameau <quinq@fifth.space>
Date: Sat, 8 Mar 2025 19:03:55 +0100
mkdep: Fix backslash escapes
We need to escape the single backslash that we want to be printed,
otherwise ed will interpret it as an escape for the following newline:
Print target: $(fooOBJS)\␊
Passed to ed: $(fooOBJS)\\␊
From heredoc: $(fooOBJS)\\\\\n
760c60d60ed363c83c22512e35a451544aaa44b72025-03-08T16:32:41Z2025-03-10T09:19:34ZMakefile: fix sed newline in replacementsQuentin Rameauquinq@fifth.spacecommit 760c60d60ed363c83c22512e35a451544aaa44b7
parent 01d3b234128ef43576161834ef6f06c79dcaf5a8
Author: Quentin Rameau <quinq@fifth.space>
Date: Sat, 8 Mar 2025 17:32:41 +0100
Makefile: fix sed newline in replacements
Sadly, it isn't possible to use special characters escape
in portable sed.
Instead, use an explicit newline character.
01d3b234128ef43576161834ef6f06c79dcaf5a82025-03-10T09:05:45Z2025-03-10T09:05:45Zlibc/darwin: Don't use MB_CUR_MAX for mbstate_tRoberto E. Vargas Caballerok0ga@shike2.comcommit 01d3b234128ef43576161834ef6f06c79dcaf5a8
parent 6f9272021fd3925a09a9e445d2ee890d29017a28
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Mon, 10 Mar 2025 10:05:45 +0100
libc/darwin: Don't use MB_CUR_MAX for mbstate_t
The definition of mbstate_t was directly copied from the darwin
headers, but it wrongly assumes that MB_CUR_MAX is defined, but
wchar.h does not. The simpliest way to solve the situation is to
hardcode the number 4, because other solutions would need an
internal macro (for example, _MB_CUR_MAX) that is converted to
MB_CUR_MAX if stdlib.h is included. Anyway that solution still
have problems, because this affects to the ABI of darwin, so
our changes to MB_CUR_MAX should not affect to this ABI.
6f9272021fd3925a09a9e445d2ee890d29017a282025-03-05T07:52:36Z2025-03-05T07:52:36Zlibc/wchar: Fix mbstate_t definition for darwinRoberto E. Vargas Caballerok0ga@shike2.comcommit 6f9272021fd3925a09a9e445d2ee890d29017a28
parent c80a983e8995a59fc34ca4c2f601c9c00fda5133
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 5 Mar 2025 08:52:36 +0100
libc/wchar: Fix mbstate_t definition for darwin
c80a983e8995a59fc34ca4c2f601c9c00fda51332025-03-04T18:52:38Z2025-03-04T18:52:38Zcc/posix: Update commentRoberto E. Vargas Caballerok0ga@shike2.comcommit c80a983e8995a59fc34ca4c2f601c9c00fda5133
parent ab077b6a7eb4f2d524d5cd53c49a3dde531cde4a
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 4 Mar 2025 19:52:38 +0100
cc/posix: Update comment
ab077b6a7eb4f2d524d5cd53c49a3dde531cde4a2025-03-04T18:45:27Z2025-03-04T18:45:27Zlibc/wchar: Define mbstate_t correctlyRoberto E. Vargas Caballerok0ga@shike2.comcommit ab077b6a7eb4f2d524d5cd53c49a3dde531cde4a
parent 3eedc954682df1ec5b47667cc27a9ab69642e7b1
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Tue, 4 Mar 2025 19:45:27 +0100
libc/wchar: Define mbstate_t correctly
The definition of the mbstate_t type depends of the target
platform, and it should be defined in the sys/cdefs.h files.
3eedc954682df1ec5b47667cc27a9ab69642e7b12025-02-26T09:14:10Z2025-02-26T09:16:20Zlibc/wchar: Add mbsinit()Roberto E. Vargas Caballerok0ga@shike2.comcommit 3eedc954682df1ec5b47667cc27a9ab69642e7b1
parent 21df8da7aed52515d5149538a9a1c5d622e4a166
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 26 Feb 2025 10:14:10 +0100
libc/wchar: Add mbsinit()
As we only support utf8 for multibyte streams the
implementation of mbsinit() is trivial because utf8
is stateless.
21df8da7aed52515d5149538a9a1c5d622e4a1662025-02-20T10:39:30Z2025-02-20T10:39:30Zlibmach/elf: Add elfrel.hRoberto E. Vargas Caballerok0ga@shike2.comcommit 21df8da7aed52515d5149538a9a1c5d622e4a166
parent e776065632d998cb8491dded4d3c809ac272f5fc
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 20 Feb 2025 11:39:30 +0100
libmach/elf: Add elfrel.h
This file was missed in a previous commit and the build was broken
but it was not catched by the developer builds.
e776065632d998cb8491dded4d3c809ac272f5fc2025-02-20T09:31:50Z2025-02-20T09:31:50Zlibmach: Use long for offsetRoberto E. Vargas Caballerok0ga@shike2.comcommit e776065632d998cb8491dded4d3c809ac272f5fc
parent 11f2d4ad18c54ed4b3147efb7554820173edd38c
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Thu, 20 Feb 2025 10:31:50 +0100
libmach: Use long for offset
As we use standard fseek() and ftell() we cannot support
files that cannot be addressed with longs, so it is better
to check for these problems when reading files and use
long after that point.
11f2d4ad18c54ed4b3147efb7554820173edd38c2025-02-19T17:36:24Z2025-02-19T17:36:24Zstrip: Minor error message changeRoberto E. Vargas Caballerok0ga@shike2.comcommit 11f2d4ad18c54ed4b3147efb7554820173edd38c
parent d0509114ad684f71ca106b6a984b00045cfe70b9
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 19 Feb 2025 18:36:24 +0100
strip: Minor error message change
d0509114ad684f71ca106b6a984b00045cfe70b92025-02-19T17:33:25Z2025-02-19T17:33:25Zobjdump/elf: Add support to print segment/section mappingRoberto E. Vargas Caballerok0ga@shike2.comcommit d0509114ad684f71ca106b6a984b00045cfe70b9
parent 079de338d0a2d275671d12756e4349f17d1b927d
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 19 Feb 2025 18:33:25 +0100
objdump/elf: Add support to print segment/section mapping
Elf makes a difference between segments and sections, being segments
the in core representation, while sections the linker representation.
Segments include into its memory space the content of the sections
and it is important to know what sections are covered by one segment,
being possible that a section is covered by more than one segment.
079de338d0a2d275671d12756e4349f17d1b927d2025-02-19T17:16:32Z2025-02-19T17:23:25Zlibmach: Rewrite the mapping functionsRoberto E. Vargas Caballerok0ga@shike2.comcommit 079de338d0a2d275671d12756e4349f17d1b927d
parent b66f5506b858ae66635d27988ee9d4dd7e0471e6
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 19 Feb 2025 18:16:32 +0100
libmach: Rewrite the mapping functions
The support for elf requires to include the segment to section
mapping, and it requires a deep rewrite of the mapping functions
and how we build the map.
b66f5506b858ae66635d27988ee9d4dd7e0471e62025-02-19T16:23:54Z2025-02-19T16:23:54Zlibmach: Remove Segment data typeRoberto E. Vargas Caballerok0ga@shike2.comcommit b66f5506b858ae66635d27988ee9d4dd7e0471e6
parent 7b4fef3358a0397fe10577d0b0ce55399953ab7d
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Wed, 19 Feb 2025 17:23:54 +0100
libmach: Remove Segment data type
The difference between segments and sections
was mainly for elf, which differentiatels between
them, but the attributes from the abstraction point
of view are the same, so we can use only one data
structure but different functions.
As the linker does not merge any sections yet,
we can just comment out the merge function
and nothing changes.