scc, branch HEAD simple c99 compiler c825c03e6f3b1e3a757a47c75d77ce57ebb1624d 2025-11-18T10:46:36Z 2025-11-18T11:07:16Z doc: Remove outdated bug Roberto E. Vargas Caballero k0ga@shike2.net commit c825c03e6f3b1e3a757a47c75d77ce57ebb1624d parent 3d92a3b0d83de06ce99f320906711d2d21f9a0c4 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 18 Nov 2025 11:46:36 +0100 doc: Remove outdated bug 3d92a3b0d83de06ce99f320906711d2d21f9a0c4 2025-10-31T17:19:56Z 2025-10-31T17:19:56Z tests/ar: Fix file name in 0039-update.sh Roberto E. Vargas Caballero k0ga@shike2.net commit 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 1ed0ff0000999561feee336c289252faf2502a7e 2025-10-29T09:57:06Z 2025-10-29T09:57:06Z tests: Set error code Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 00bae5c394c9b1d31586ffa1ee2f77a3edcc6f0a 2025-10-28T20:21:11Z 2025-10-28T20:21:11Z tests/make: Reduce the timeout for 0102-signal Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 65e5c373ca2fa947a604a1e0ea35843c8c104658 2025-10-28T20:12:08Z 2025-10-28T20:12:08Z make: Use a local signal variable Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 93e07bb34a825734d760971f811ac43868fd8c48 2025-10-28T20:10:31Z 2025-10-28T20:10:31Z scc-make: Avoid signal race conditions Roberto E. Vargas Caballero k0ga@shike2.net commit 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. e19109cd35b8d64480c74389b8faaedf5af9b0ed 2025-10-17T07:40:03Z 2025-10-17T07:40:03Z tests/make: Increment timeout for 0102-signal Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 6d9a517cf4c6b5133030b9744531340d22cef719 2025-10-16T11:22:18Z 2025-10-17T07:39:55Z build: Modify include path Roberto E. Vargas Caballero k0ga@shike2.net commit 6d9a517cf4c6b5133030b9744531340d22cef719 parent 6c3c992dc8f759f8c4052a4fb0d47d7681282664 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Thu, 16 Oct 2025 13:22:18 +0200 build: Modify include path 6c3c992dc8f759f8c4052a4fb0d47d7681282664 2025-08-05T12:00:25Z 2025-08-05T12:00:25Z Merge remote-tracking branch 'origin/master' Roberto E. Vargas Caballero k0ga@shike2.net commit 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' 23c081533234d616d3cc57e5794ee1b9f2a87b63 2025-08-05T11:53:18Z 2025-08-05T11:53:18Z make: Make cleanup void Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 2a2e57ae043b6d78a5dbd50761971d6508540729 2025-06-17T18:16:23Z 2025-06-17T19:05:29Z libc/malloc: Unify malloc and realloc Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 2b33af36beceaf67507ab881f113d68a371a4f13 2025-06-17T19:04:13Z 2025-06-17T19:05:29Z tests/make: Unset MAKEFLAGS Roberto E. Vargas Caballero k0ga@shike2.net commit 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. ac449d18a971e3e452e3f47cbd2af90b6a55ea18 2025-06-13T20:31:14Z 2025-06-17T16:41:17Z scc-make: parseargv(): properly handle the -- argument, add test. Z. Gilboa writeonce@midipix.org commit 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. 30255fb57a7b5abf021e417aa34f380ae92bdbbe 2025-06-14T07:42:49Z 2025-06-17T07:48:14Z .gitignore: add missing entry for /src/cmd/scc-dump. Z. Gilboa writeonce@midipix.org commit 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. 63c66208e583d8538351428cb2d5bdf0aabe3e26 2025-06-04T14:36:22Z 2025-06-04T14:36:22Z driver/posix: Enable QBE for any arch/abi Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 1f8f494a8504aa99052554476d86bcd0d6a7a1ba 2025-06-04T14:31:49Z 2025-06-04T14:31:49Z driver/posix: Adjust qbe command line based in the target Roberto E. Vargas Caballero k0ga@shike2.net commit 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. d853268357f02d13ca7377e2391b8ebb6290daad 2025-06-04T14:08:26Z 2025-06-04T14:08:26Z cc2: Add support for qbe riscv64 Roberto E. Vargas Caballero k0ga@shike2.net commit 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 faf643c9afc0a74b276f24a8fdb4ba8552e351b3 2025-06-04T14:08:07Z 2025-06-04T14:08:07Z cc2/arm64: Removed unused peep.c Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 06266207ce41e9fa1b7c2232b0a0243481287fd6 2025-06-04T14:06:01Z 2025-06-04T14:06:01Z cc1: Add support for riscv64 Roberto E. Vargas Caballero k0ga@shike2.net commit 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 7d92f9f22004c00fca2fe52a183b8d8e1a1bca6f 2025-05-27T18:19:30Z 2025-05-27T18:19:30Z build: Remove redundant make build Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 6182ec6e314de95182742064f5bb2d80abf11c8c 2025-05-24T04:54:25Z 2025-05-24T04:57:54Z libc/vfprintf: Adjust variable types Roberto E. Vargas Caballero k0ga@shike2.net commit 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 9c55c9b38fb53863c83f8d59ea6241682b2ea463 2025-05-13T08:14:24Z 2025-05-13T08:14:24Z doc: Clarify how to use musl Roberto E. Vargas Caballero k0ga@shike2.net commit 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 5900420c8566844b1e379dc62adb0467142f56d6 2025-05-12T20:28:28Z 2025-05-12T20:28:28Z build: Use SCCMAKE instead of SMAKE Roberto E. Vargas Caballero k0ga@shike2.net commit 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). 1f6bfcd9114a69b495191dbc3d96c27e1468a8f9 2025-05-11T18:31:23Z 2025-05-12T10:01:57Z test/cc: Add 0231-init.c Roberto E. Vargas Caballero k0ga@shike2.net commit 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 dfbe125c3b0d001a9f0d671c6adfdb41e488e8cf 2025-04-28T08:55:23Z 2025-04-28T08:55:23Z cc1: Allow struct assigments in initialization Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 11236c88e689f884619332bedbffd3501916f887 2025-04-25T08:27:33Z 2025-04-25T08:27:33Z cc1: Initialize correctly unions Xavier Del Campo Romero xavi92@disroot.org commit 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. 2c35688619f6c5804106dfe52ee199894eb6b056 2025-04-25T07:22:59Z 2025-04-25T07:22:59Z build: Bootstrap scc using scc-make Roberto E. Vargas Caballero k0ga@shike2.net commit 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. d0ec99aaad5f303dfbd9fd0e094856f7f78c106d 2025-04-21T20:08:39Z 2025-04-21T20:30:29Z libc: Add macro definition for setjmp Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 26962956798171998310076e26dd086187ea5ba9 2025-04-18T21:40:57Z 2025-04-19T07:11:18Z build: Remove lorder Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 027d5ed74d0e1195669b4f7d7a1531a82f3441e0 2025-04-18T20:55:07Z 2025-04-18T20:55:07Z Merge remote-tracking branch 'origin/master' Roberto E. Vargas Caballero k0ga@shike2.net commit 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' 23beeedce6a5a56ce4a12dbb96178fc165e913b4 2025-04-18T20:52:50Z 2025-04-18T20:52:50Z doc: Unify license information Roberto E. Vargas Caballero k0ga@shike2.net commit 23beeedce6a5a56ce4a12dbb96178fc165e913b4 parent 473b289e3176157e7674cf676ec1ef56a8c04e02 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 18 Apr 2025 22:52:50 +0200 doc: Unify license information 64470722a2a80a6b9144a79a162e11e8a0c2b7fb 2025-04-09T15:15:48Z 2025-04-12T09:58:24Z Fix double free in swtch.c remph lhr@disroot.org commit 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. d5d0d662f6a48cf922d524b0df11911bde263fac 2025-04-09T15:10:00Z 2025-04-12T09:47:43Z tests/libc: Fix wchar tests lhr@disroot.org lhr@disroot.org commit d5d0d662f6a48cf922d524b0df11911bde263fac parent 473b289e3176157e7674cf676ec1ef56a8c04e02 Author: lhr@disroot.org <lhr@disroot.org> Date: Wed, 9 Apr 2025 16:10:00 +0100 tests/libc: Fix wchar tests 473b289e3176157e7674cf676ec1ef56a8c04e02 2025-04-07T13:17:39Z 2025-04-07T13:17:39Z libc/openbsd: fix int_fast64_t definition Lucas Gabriel Vuotto lucas@lgv5.net commit 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 1127a487c737f972f98aeb54bd29e599e5c6af85 2025-04-02T07:42:19Z 2025-04-02T07:42:19Z tests/libc: Remove errno check Roberto E. Vargas Caballero k0ga@shike2.net commit 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. a6e12fcc40f07b3e465dba61249f86e1b2b25d38 2025-03-28T11:49:17Z 2025-03-28T11:49:17Z libc/wchar: Remove useless state in wc* Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 68ad37c9bee5f12c0804f165a5176e4bbf4b4898 2025-03-28T08:42:13Z 2025-03-28T08:42:13Z libc/wchar: Simplify mbsrtowc() and mbstowc() Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 29f51dd9ea6407ff5d6386d7dc82cd499185533e 2025-03-27T21:11:35Z 2025-03-27T21:11:35Z libc/wchar: Remove state from mbtowc() Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 115f7694ce1502f57bb72b9e34d8816c5224e843 2025-03-27T12:09:21Z 2025-03-27T14:39:20Z tests/cc: Reuse 0193-incomplete Roberto E. Vargas Caballero k0ga@shike2.net commit 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 0cc26f9abb8c7f8a5ad30563d63bda35a5345322 2025-03-26T13:46:30Z 2025-03-26T13:46:30Z libc/wchar: Add wcspbrk() Roberto E. Vargas Caballero k0ga@shike2.net commit 0cc26f9abb8c7f8a5ad30563d63bda35a5345322 parent 281fd80448d875367f4be096a00ebbc847a06c1b Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 26 Mar 2025 14:46:30 +0100 libc/wchar: Add wcspbrk() 281fd80448d875367f4be096a00ebbc847a06c1b 2025-03-26T13:41:30Z 2025-03-26T13:41:30Z libc/string: Simplify strpbrk() Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 5a4639f2e13052cfd4ff099cf1fcee020af58a55 2025-03-26T13:34:58Z 2025-03-26T13:34:58Z libc/wchar: Add wcscspn() Roberto E. Vargas Caballero k0ga@shike2.net commit 5a4639f2e13052cfd4ff099cf1fcee020af58a55 parent d21aa5a5a185cacd7a63439788287ef6564ad5e2 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 26 Mar 2025 14:34:58 +0100 libc/wchar: Add wcscspn() d21aa5a5a185cacd7a63439788287ef6564ad5e2 2025-03-26T13:26:21Z 2025-03-26T13:29:56Z libc/wchar: Add wcsspn() Roberto E. Vargas Caballero k0ga@shike2.net commit d21aa5a5a185cacd7a63439788287ef6564ad5e2 parent aef615310c0729e97e4ad5a2e4206266660679a2 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 26 Mar 2025 14:26:21 +0100 libc/wchar: Add wcsspn() aef615310c0729e97e4ad5a2e4206266660679a2 2025-03-26T13:14:28Z 2025-03-26T13:14:28Z libc/wchar: Add wcsxfrm() Roberto E. Vargas Caballero k0ga@shike2.net commit aef615310c0729e97e4ad5a2e4206266660679a2 parent 09245abd272928c778c739e2402517a464b1a678 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 26 Mar 2025 14:14:28 +0100 libc/wchar: Add wcsxfrm() 09245abd272928c778c739e2402517a464b1a678 2025-03-25T20:44:30Z 2025-03-25T20:44:30Z libc/wchar: Add wcsstr() Roberto E. Vargas Caballero k0ga@shike2.net commit 09245abd272928c778c739e2402517a464b1a678 parent 1b9b9b8ada90d264546916bc65e2867ba3a0fca3 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 25 Mar 2025 21:44:30 +0100 libc/wchar: Add wcsstr() 1b9b9b8ada90d264546916bc65e2867ba3a0fca3 2025-03-25T20:32:52Z 2025-03-25T20:39:12Z libc/wchar: Add wcsrchr() Roberto E. Vargas Caballero k0ga@shike2.net commit 1b9b9b8ada90d264546916bc65e2867ba3a0fca3 parent 8a6918d48bb8ecbc1c2af2c72b2e89a3df3a999b Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 25 Mar 2025 21:32:52 +0100 libc/wchar: Add wcsrchr() 8a6918d48bb8ecbc1c2af2c72b2e89a3df3a999b 2025-03-25T20:26:58Z 2025-03-25T20:26:58Z libc/wchar: Add wcschr() Roberto E. Vargas Caballero k0ga@shike2.net commit 8a6918d48bb8ecbc1c2af2c72b2e89a3df3a999b parent 4ac2c9373b1004d4176807d0b106c97cbdab8163 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 25 Mar 2025 21:26:58 +0100 libc/wchar: Add wcschr() 4ac2c9373b1004d4176807d0b106c97cbdab8163 2025-03-25T19:56:32Z 2025-03-25T20:14:20Z libc/wchar: Add wcsncat() Roberto E. Vargas Caballero k0ga@shike2.net commit 4ac2c9373b1004d4176807d0b106c97cbdab8163 parent 949d7de20391cbcb0a6ce10cf2080abb7914b6b5 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 25 Mar 2025 20:56:32 +0100 libc/wchar: Add wcsncat() 949d7de20391cbcb0a6ce10cf2080abb7914b6b5 2025-03-25T19:50:32Z 2025-03-25T19:55:37Z libc/wchar: Add wcscat() Roberto E. Vargas Caballero k0ga@shike2.net commit 949d7de20391cbcb0a6ce10cf2080abb7914b6b5 parent 7aa86bd1b38fb9ddd568ed8c13f534a274f50fbb Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 25 Mar 2025 20:50:32 +0100 libc/wchar: Add wcscat() 7aa86bd1b38fb9ddd568ed8c13f534a274f50fbb 2025-03-25T19:34:38Z 2025-03-25T19:34:38Z libc/wchar: Add wcsncpy() Roberto E. Vargas Caballero k0ga@shike2.net commit 7aa86bd1b38fb9ddd568ed8c13f534a274f50fbb parent 7dcb0d9d9eee6306f01cf4788b8eef1fa9baa9c7 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 25 Mar 2025 20:34:38 +0100 libc/wchar: Add wcsncpy() 7dcb0d9d9eee6306f01cf4788b8eef1fa9baa9c7 2025-03-25T18:49:46Z 2025-03-25T18:49:46Z libc/wchar: Add wmemset() Roberto E. Vargas Caballero k0ga@shike2.net commit 7dcb0d9d9eee6306f01cf4788b8eef1fa9baa9c7 parent d7543e2d9e5bc064ac6f1b2469511aae17f0ad52 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 25 Mar 2025 19:49:46 +0100 libc/wchar: Add wmemset() d7543e2d9e5bc064ac6f1b2469511aae17f0ad52 2025-03-25T18:35:22Z 2025-03-25T18:39:26Z tests/wchar: Add wmemmove() Roberto E. Vargas Caballero k0ga@shike2.net commit d7543e2d9e5bc064ac6f1b2469511aae17f0ad52 parent 32c148f21e31e4db0d6f05298c8f5b2d2ad7d9c1 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 25 Mar 2025 19:35:22 +0100 tests/wchar: Add wmemmove() 32c148f21e31e4db0d6f05298c8f5b2d2ad7d9c1 2025-03-25T18:15:00Z 2025-03-25T18:39:26Z libc/wchar: Add wmemcmp() Roberto E. Vargas Caballero k0ga@shike2.net commit 32c148f21e31e4db0d6f05298c8f5b2d2ad7d9c1 parent f82bc6684d7c33065ce616b79528e7a0e439d1df Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 25 Mar 2025 19:15:00 +0100 libc/wchar: Add wmemcmp() f82bc6684d7c33065ce616b79528e7a0e439d1df 2025-03-25T18:03:27Z 2025-03-25T18:39:26Z libc/wchar: Add wmemcpy() Roberto E. Vargas Caballero k0ga@shike2.net commit f82bc6684d7c33065ce616b79528e7a0e439d1df parent 391c2dacb748852e77bfe811556b145ecdda684b Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 25 Mar 2025 19:03:27 +0100 libc/wchar: Add wmemcpy() 391c2dacb748852e77bfe811556b145ecdda684b 2025-03-25T17:36:39Z 2025-03-25T17:36:39Z libc/string: Improve memchr() Roberto E. Vargas Caballero k0ga@shike2.net commit 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. bbb33960d11eacc45a1ea00d60bf46a39ae9693b 2025-03-25T17:30:34Z 2025-03-25T17:30:34Z libc/wchar: Add wmemchr() Roberto E. Vargas Caballero k0ga@shike2.net commit bbb33960d11eacc45a1ea00d60bf46a39ae9693b parent 3b42911841f616a37e3fa7bd5f4ad7177ce959cf Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 25 Mar 2025 18:30:34 +0100 libc/wchar: Add wmemchr() 3b42911841f616a37e3fa7bd5f4ad7177ce959cf 2025-03-25T09:52:47Z 2025-03-25T09:52:47Z Merge remote-tracking branch 'origin/master' into wchar Roberto E. Vargas Caballero k0ga@shike2.com commit 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 b96ef460770e7d0bf335cbadbed7efd2db08199e 2025-03-25T09:50:48Z 2025-03-25T09:50:48Z libc/stdio: Remove unneeded initialization Roberto E. Vargas Caballero k0ga@shike2.com commit 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. 8a18b4fd343760cf387e59ca9d27ffc2ef9b1ffa 2025-03-25T07:21:50Z 2025-03-25T07:21:50Z tests/libc: Add a new invalid utf-8 test case Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 94d009f0d25f0426186fe0f209abc1f229c47d12 2025-03-24T08:54:26Z 2025-03-24T08:54:26Z libc/wchar: Add wcscpy() Roberto E. Vargas Caballero k0ga@shike2.net commit 94d009f0d25f0426186fe0f209abc1f229c47d12 parent c5af9fc33eda2506eebc629d07a09e637e3311f2 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Mon, 24 Mar 2025 09:54:26 +0100 libc/wchar: Add wcscpy() c5af9fc33eda2506eebc629d07a09e637e3311f2 2025-03-22T09:32:25Z 2025-03-22T09:32:25Z libc/stdlib: Use state in mbstowcs and wcstombs Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 32ebae08d603f27be737d19728d48f2a9859de50 2025-03-22T09:27:54Z 2025-03-22T09:30:39Z libc/wchar: Add wcscoll() Roberto E. Vargas Caballero k0ga@shike2.net commit 32ebae08d603f27be737d19728d48f2a9859de50 parent 36606c7df70f2465a4305395c529e7ea1add693f Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Sat, 22 Mar 2025 10:27:54 +0100 libc/wchar: Add wcscoll() 36606c7df70f2465a4305395c529e7ea1add693f 2025-03-21T18:23:17Z 2025-03-21T18:23:17Z tests/libc: Add 0042-mbsrtowc Roberto E. Vargas Caballero k0ga@shike2.net commit 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 01921365fc084e3b592c00bdd090d0d457502904 2025-03-21T18:21:44Z 2025-03-21T18:21:44Z libc/wchar: Add wcsncmp() Roberto E. Vargas Caballero k0ga@shike2.net commit 01921365fc084e3b592c00bdd090d0d457502904 parent e5399b363bcd8af06edc6bb4ba9edb034bcbe728 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 21 Mar 2025 19:21:44 +0100 libc/wchar: Add wcsncmp() e5399b363bcd8af06edc6bb4ba9edb034bcbe728 2025-03-21T10:43:34Z 2025-03-21T10:43:34Z tests/libc: Add 0045-wcscmp Roberto E. Vargas Caballero k0ga@shike2.net commit 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 e74078b4eed9b2365e67d58f97d2964bec425aac 2025-03-21T10:42:59Z 2025-03-21T10:42:59Z libc/wchar: Add wcscmp() Roberto E. Vargas Caballero k0ga@shike2.net commit e74078b4eed9b2365e67d58f97d2964bec425aac parent d55ef47946e20f9acb7601cb3c05247056c802e4 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 21 Mar 2025 11:42:59 +0100 libc/wchar: Add wcscmp() d55ef47946e20f9acb7601cb3c05247056c802e4 2025-03-21T10:41:53Z 2025-03-21T10:41:53Z libc/string: Simplify strcmp Roberto E. Vargas Caballero k0ga@shike2.net commit d55ef47946e20f9acb7601cb3c05247056c802e4 parent 3f16edee3f63d37bcd7f41aec82daec377faf09f Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 21 Mar 2025 11:41:53 +0100 libc/string: Simplify strcmp 3f16edee3f63d37bcd7f41aec82daec377faf09f 2025-03-21T10:21:51Z 2025-03-21T10:21:51Z libc/wchar: Group mem and str functions Roberto E. Vargas Caballero k0ga@shike2.net commit 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. e9db6f680a03e9d71d1b4091560599c84448cd39 2025-03-21T10:20:42Z 2025-03-21T10:20:42Z tests/libc: Add 0044-wcslen test Roberto E. Vargas Caballero k0ga@shike2.net commit 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 0827b4938a966940d42e0382c4fd16d325110c8d 2025-03-21T08:14:06Z 2025-03-21T08:14:06Z libc/wchar: Group single wchar I/O functions Roberto E. Vargas Caballero k0ga@shike2.net commit 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. e7d90888786b65dee9fec9deb9c880857d6e4d8c 2025-03-21T07:51:48Z 2025-03-21T07:51:48Z tests/libc: Add 0041-mbrlen to .gitignore Roberto E. Vargas Caballero k0ga@shike2.net commit 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 8b488b39369013d53b7fea4419f213e7b04a6604 2025-03-20T21:29:25Z 2025-03-20T21:29:25Z libc/wchar: Remove macros for mblen and mbrlen Roberto E. Vargas Caballero k0ga@shike2.net commit 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. a378af318684a868015e1efa73b14ab525d3ac27 2025-03-20T19:28:37Z 2025-03-20T19:35:12Z tests/libc: Add 0041-mbrlen() Roberto E. Vargas Caballero k0ga@shike2.net commit 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() c675740de75457783b309d357f586a768cf31fed 2025-03-20T19:23:33Z 2025-03-20T19:35:12Z libc/stdlib: Use internal state in wctomb() Roberto E. Vargas Caballero k0ga@shike2.net commit 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. 6f13ed360e15b5daa1df2c2de39dc93422db4255 2025-03-20T19:07:17Z 2025-03-20T19:35:12Z libc/wchar: Use hidden state in mblen and mbrlen Roberto E. Vargas Caballero k0ga@shike2.net commit 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. abc7bb9f69d648be0457170d1f491594cbb2f7e7 2025-03-20T16:05:17Z 2025-03-20T16:05:17Z tests/libc: Add 0040-wcrtomb Roberto E. Vargas Caballero k0ga@shike2.net commit 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 94afd0b6e12799c59effe955f41b3aaf53003ed7 2025-03-20T16:01:44Z 2025-03-20T16:01:44Z libc/wchar: Fix unicode range Roberto E. Vargas Caballero k0ga@shike2.net commit 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. d0c96fd6db74dca3d53aca43116de9597c43944b 2025-03-20T09:58:51Z 2025-03-20T09:58:51Z make: Add more debug output Roberto E. Vargas Caballero k0ga@shike2.net commit 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 d66da367d6d4052bdcea205b600c84fa30de2bd2 2025-03-17T16:26:12Z 2025-03-17T16:26:12Z tests/make: Add 0107-inference Roberto E. Vargas Caballero k0ga@shike2.com commit 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 61c6638246049b2085f1ef70e5b478c088d1f7da 2025-03-17T15:58:03Z 2025-03-17T15:58:03Z make: Check target name in dependencies Roberto E. Vargas Caballero k0ga@shike2.com commit 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. 5bc57804faae91164edcd9f3aec054da4825b423 2025-03-11T13:28:07Z 2025-03-11T16:33:14Z tests/libc: Add 0039-mbrtowc Roberto E. Vargas Caballero k0ga@shike2.com commit 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 1136d831017b0b7052b45899d08093d8f4034ce8 2025-03-11T13:25:06Z 2025-03-11T13:25:06Z tests/libc: Add 0038-mbsinit Roberto E. Vargas Caballero k0ga@shike2.com commit 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 b4b507633186e7f223231a60447d82a6e3ab92af 2025-03-10T20:22:52Z 2025-03-11T12:06:07Z libc/wchar: Rewrite mbtowc() Roberto E. Vargas Caballero k0ga@shike2.com commit 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. f507bae3a0e45b6f9eeadecb3065afaea1a6d6bc 2025-02-22T12:14:54Z 2025-03-10T13:14:15Z make/posix: Fix feature test macros remph lhr@disroot.org commit 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. dee0c6f0c90f7d64fd45cb6e3c48321f4beaf81d 2025-02-26T09:31:51Z 2025-03-10T13:13:41Z libc/wchar: Fix unicode handling Roberto E. Vargas Caballero k0ga@shike2.com commit 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 2eaef0900f5ebd9f00bebd8ce899423a0b37b4bb 2025-02-22T12:14:53Z 2025-03-10T13:09:32Z libc/tests: add omitted headers remph lhr@disroot.org commit 2eaef0900f5ebd9f00bebd8ce899423a0b37b4bb parent 7033385eda09474ab9a8e21ae811d916e3856ce6 Author: remph <lhr@disroot.org> Date: Sat, 22 Feb 2025 13:14:53 +0100 libc/tests: add omitted headers 7033385eda09474ab9a8e21ae811d916e3856ce6 2025-03-10T12:57:08Z 2025-03-10T13:03:22Z libc: Add get/set for mbstate_t Roberto E. Vargas Caballero k0ga@shike2.com commit 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. b454c47b530863e732c6100728d35e8e663d3a5d 2025-03-08T18:03:55Z 2025-03-10T10:06:01Z mkdep: Fix backslash escapes Quentin Rameau quinq@fifth.space commit 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 760c60d60ed363c83c22512e35a451544aaa44b7 2025-03-08T16:32:41Z 2025-03-10T09:19:34Z Makefile: fix sed newline in replacements Quentin Rameau quinq@fifth.space commit 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. 01d3b234128ef43576161834ef6f06c79dcaf5a8 2025-03-10T09:05:45Z 2025-03-10T09:05:45Z libc/darwin: Don't use MB_CUR_MAX for mbstate_t Roberto E. Vargas Caballero k0ga@shike2.com commit 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. 6f9272021fd3925a09a9e445d2ee890d29017a28 2025-03-05T07:52:36Z 2025-03-05T07:52:36Z libc/wchar: Fix mbstate_t definition for darwin Roberto E. Vargas Caballero k0ga@shike2.com commit 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 c80a983e8995a59fc34ca4c2f601c9c00fda5133 2025-03-04T18:52:38Z 2025-03-04T18:52:38Z cc/posix: Update comment Roberto E. Vargas Caballero k0ga@shike2.com commit c80a983e8995a59fc34ca4c2f601c9c00fda5133 parent ab077b6a7eb4f2d524d5cd53c49a3dde531cde4a Author: Roberto E. Vargas Caballero <k0ga@shike2.com> Date: Tue, 4 Mar 2025 19:52:38 +0100 cc/posix: Update comment ab077b6a7eb4f2d524d5cd53c49a3dde531cde4a 2025-03-04T18:45:27Z 2025-03-04T18:45:27Z libc/wchar: Define mbstate_t correctly Roberto E. Vargas Caballero k0ga@shike2.com commit 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. 3eedc954682df1ec5b47667cc27a9ab69642e7b1 2025-02-26T09:14:10Z 2025-02-26T09:16:20Z libc/wchar: Add mbsinit() Roberto E. Vargas Caballero k0ga@shike2.com commit 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. 21df8da7aed52515d5149538a9a1c5d622e4a166 2025-02-20T10:39:30Z 2025-02-20T10:39:30Z libmach/elf: Add elfrel.h Roberto E. Vargas Caballero k0ga@shike2.com commit 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. e776065632d998cb8491dded4d3c809ac272f5fc 2025-02-20T09:31:50Z 2025-02-20T09:31:50Z libmach: Use long for offset Roberto E. Vargas Caballero k0ga@shike2.com commit 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. 11f2d4ad18c54ed4b3147efb7554820173edd38c 2025-02-19T17:36:24Z 2025-02-19T17:36:24Z strip: Minor error message change Roberto E. Vargas Caballero k0ga@shike2.com commit 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 d0509114ad684f71ca106b6a984b00045cfe70b9 2025-02-19T17:33:25Z 2025-02-19T17:33:25Z objdump/elf: Add support to print segment/section mapping Roberto E. Vargas Caballero k0ga@shike2.com commit 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. 079de338d0a2d275671d12756e4349f17d1b927d 2025-02-19T17:16:32Z 2025-02-19T17:23:25Z libmach: Rewrite the mapping functions Roberto E. Vargas Caballero k0ga@shike2.com commit 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. b66f5506b858ae66635d27988ee9d4dd7e0471e6 2025-02-19T16:23:54Z 2025-02-19T16:23:54Z libmach: Remove Segment data type Roberto E. Vargas Caballero k0ga@shike2.com commit 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.