scc, branch HEAD simple c99 compiler 575a2d87cac49174b7f53aa6ac5f9186c2165697 2026-08-19T18:32:01Z 2026-08-24T16:22:51Z Don't specify a QBE return type for C functions with void return type Sören Tempel soeren+git@soeren-tempel.net commit 575a2d87cac49174b7f53aa6ac5f9186c2165697 parent cc00e16d081e5f802f046bc0a40ef597a4af1c0e Author: Sören Tempel <soeren+git@soeren-tempel.net> Date: Wed, 19 Aug 2026 20:32:01 +0200 Don't specify a QBE return type for C functions with void return type Without this patch, SCC currently emits QBE functions that have a "w" return type for C functions that have a void return type. However, in the return statement of these functions, it doesn't return a value. Depending on the reader's interpretation, one could argue that this is in violation of the QBE specification, which states: “All return values of this function must have [the specified] return type” [1]. Arguably, a ret instruction without an argument does not have a "w" return type. qbe(1) itself accepts this, but other tooling built around QBE may not. With this patch, functions with zero-sized types are now represented as not having a return type in the QBE representation. Further, the emitted QBE call instruction no longer assigns the return value of functions with a void return type to a temporary. This was discovered while executing SCC's emitted QBE representation using quebex, a software analysis framework that comes with its own standalone implementation of the QBE specification [2]. [1]: https://c9x.me/compile/doc/il.html#Functions [2]: https://git.8pit.net/quebex cc00e16d081e5f802f046bc0a40ef597a4af1c0e 2026-06-24T09:35:06Z 2026-06-26T21:38:10Z cc2/qbe: Fix post increment and decrement Zhaoming Luo zhml@posteo.com commit cc00e16d081e5f802f046bc0a40ef597a4af1c0e parent 0768762d445cd3850147a54ea6625f72e5c1a8e4 Author: Zhaoming Luo <zhml@posteo.com> Date: Wed, 24 Jun 2026 09:35:06 +0000 cc2/qbe: Fix post increment and decrement These operators use their operand as lhs and rhs. Function lhs_rhs() calls lhs() and may modify variable 'l'. When the operator is pointer dereference or struct/union field access, the variable 'l' will be modifed to a pointer type node pointing to the value of lhs. After that, in load(), choose the QBE load instruction based on the lhs type. Because 'l' may be modifed to a pointer type node, 'l->type' may be different to the lhs type; if it's the case, it may happen using an address to a 32 bits value to get a 64 bits value. Therefore, 'l->type' should not be used to define the QBE load instruction. Use 'r->type' because the value of 'r' is not modified, and the type of 'lhs' and 'rhs' are the same, otherwise they can't be operands of the same expression. Also add the tests for this fix. Co-authored-by: Roberto E. Vargas Caballero <k0ga@shike2.net> 0768762d445cd3850147a54ea6625f72e5c1a8e4 2026-06-26T20:27:00Z 2026-06-26T20:27:00Z build: Update proto.all after removing gcc-scc Roberto E. Vargas Caballero k0ga@shike2.net commit 0768762d445cd3850147a54ea6625f72e5c1a8e4 parent 027ea37e73f2faca232788a21dd1d1280c74adbc Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 26 Jun 2026 22:27:00 +0200 build: Update proto.all after removing gcc-scc 027ea37e73f2faca232788a21dd1d1280c74adbc 2026-06-18T11:40:08Z 2026-06-18T11:47:57Z cc1: Pretty format cpp output Roberto E. Vargas Caballero k0ga@shike2.net commit 027ea37e73f2faca232788a21dd1d1280c74adbc parent 89f23214f7e97af01aea675a2a24650fbc5d77ea Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Thu, 18 Jun 2026 13:40:08 +0200 cc1: Pretty format cpp output The output of cc1 -E was ugly because indentation was lost and because spaces were blindly added just to avoid token concatenation. This patch solves the problem in a easy way because we can access directly the input line to recover the leading spaces and we already have the variable yyspace, which holds the last space seen, but it was mangled by expandarg() to handle spaces correctly for stringize of macro parameters. We just save the space value before the macro and then we restore after the expansion was done because we don't care about intermediate spaces, just spaces before the expansion of the macro. 89f23214f7e97af01aea675a2a24650fbc5d77ea 2026-06-17T17:53:05Z 2026-06-17T17:53:05Z test/cc: Ignore 0275-struct Roberto E. Vargas Caballero k0ga@shike2.net commit 89f23214f7e97af01aea675a2a24650fbc5d77ea parent ac0fa861813f8101072d96af883e47e610365ebc Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 17 Jun 2026 19:53:05 +0200 test/cc: Ignore 0275-struct ac0fa861813f8101072d96af883e47e610365ebc 2026-06-17T17:40:14Z 2026-06-17T17:40:14Z cc1: Fix intersect() Roberto E. Vargas Caballero k0ga@shike2.net commit ac0fa861813f8101072d96af883e47e610365ebc parent d56373f248e2f819620ae0e192bc09f79500398b Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 17 Jun 2026 19:40:14 +0200 cc1: Fix intersect() Intersect() was assuming that hidesets were NULL terminated, but addhideset() ran over the full array filling all the possible positions. Having NULL terminated arrays make easier to run over them, and as we have plenty of space in the hidesets instead of changing intersect() is better to change addhideset() and have NULL terminated arrays. This simplifies sethideset() and unsethideset(). d56373f248e2f819620ae0e192bc09f79500398b 2026-06-17T16:39:06Z 2026-06-17T16:39:06Z cc1: Fix handling of NOEXPAND and EXPAND Roberto E. Vargas Caballero k0ga@shike2.net commit d56373f248e2f819620ae0e192bc09f79500398b parent 3a0f8b791fc7bbd0f33a4004d22c5c36563b1b9b Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 17 Jun 2026 18:39:06 +0200 cc1: Fix handling of NOEXPAND and EXPAND When they happen we have to modify disexpand and move to the next character, but we were passing c with the NOEXPAND or EXPAND value to the lexer, which due to a casuality was finally working but only due to casuality (a weird one). 3a0f8b791fc7bbd0f33a4004d22c5c36563b1b9b 2026-06-17T14:08:12Z 2026-06-17T14:08:12Z cc1:Improve size checking in expandargs() Roberto E. Vargas Caballero k0ga@shike2.net commit 3a0f8b791fc7bbd0f33a4004d22c5c36563b1b9b parent c8bd4d46eef4cd45ead39a21da8b589b2e9cde1b Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 17 Jun 2026 16:08:12 +0200 cc1:Improve size checking in expandargs() c8bd4d46eef4cd45ead39a21da8b589b2e9cde1b 2026-06-17T13:41:10Z 2026-06-17T13:41:10Z cc1: Remove outdated TODO Roberto E. Vargas Caballero k0ga@shike2.net commit c8bd4d46eef4cd45ead39a21da8b589b2e9cde1b parent c4b7c0458ffee84c043739645afe0aedffb906ed Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 17 Jun 2026 15:41:10 +0200 cc1: Remove outdated TODO Changing that means changing scc. c4b7c0458ffee84c043739645afe0aedffb906ed 2026-06-17T12:44:08Z 2026-06-17T12:44:08Z Merge remote-tracking branch 'origin/master' Roberto E. Vargas Caballero k0ga@shike2.net commit c4b7c0458ffee84c043739645afe0aedffb906ed parent 2b37e1b627adcc3ec5db9ec47cd91669d8bfb8a5 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 17 Jun 2026 14:44:08 +0200 Merge remote-tracking branch 'origin/master' 2b37e1b627adcc3ec5db9ec47cd91669d8bfb8a5 2026-06-17T11:46:24Z 2026-06-17T12:42:42Z tests/cc: Mark 0189-cpp as resolved Roberto E. Vargas Caballero k0ga@shike2.net commit 2b37e1b627adcc3ec5db9ec47cd91669d8bfb8a5 parent f89df166f2425304ff0ab221940e41a1b8ea079f Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 17 Jun 2026 13:46:24 +0200 tests/cc: Mark 0189-cpp as resolved f89df166f2425304ff0ab221940e41a1b8ea079f 2026-06-17T07:52:15Z 2026-06-17T12:41:39Z cc1: Mark hidden tokens Roberto E. Vargas Caballero k0ga@shike2.net commit f89df166f2425304ff0ab221940e41a1b8ea079f parent c9d3ab93258058932a722957c30d16c41a48615b Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 17 Jun 2026 09:52:15 +0200 cc1: Mark hidden tokens The input hideset approximation works very well because we are able to maintain the hideset for every change in the hideset, but it fails when we fully expand a macro, because then the rescan loses the hideset information. To solve it, we have to introduce annotation tokens to the lexer to signal it that it should disable expansions between a NOEXPAND and a EXPAND. These tokens are always consumed by the lexer or the macro expansion and they are not shown ever in the -E output or the grammar parser, because they always appear in a buffer associated to a IMACRO input that is consumed by the lexer to generate the tokens seen by the grammar parser. c9d3ab93258058932a722957c30d16c41a48615b 2026-06-17T12:37:22Z 2026-06-17T12:37:22Z cc1: Remove colons in INPUT DBG Roberto E. Vargas Caballero k0ga@shike2.net commit c9d3ab93258058932a722957c30d16c41a48615b parent d59f0b5d2d11178047efaa052eb6659e48bb827e Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 17 Jun 2026 14:37:22 +0200 cc1: Remove colons in INPUT DBG Just be consistent wit other DBG statements. d59f0b5d2d11178047efaa052eb6659e48bb827e 2026-06-16T20:07:09Z 2026-06-17T12:36:57Z cc1: Add hideset by input Roberto E. Vargas Caballero k0ga@shike2.net commit d59f0b5d2d11178047efaa052eb6659e48bb827e parent cd2e378821e5e5f86215643e87a6b806a8b54492 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 16 Jun 2026 22:07:09 +0200 cc1: Add hideset by input Having a hideset by input allows to follow the Prosser algorithm [1], because hideset changes happens only when expansions happen, so we can continue using the push up input streams to implemenet the algorithm while we maintain the hideset for every new input push up. [1] https://www.spinellis.gr/blog/20060626/cpp.algo.pdf bbd527058259a2bac5fed45610949b110645e805 2026-06-09T12:23:28Z 2026-06-10T07:26:32Z Make it easier to configure the name of the QBE binary Sören Tempel soeren@soeren-tempel.net commit bbd527058259a2bac5fed45610949b110645e805 parent ab709ce7d4bc60982fa69b0956e58e9330892f2c Author: Sören Tempel <soeren@soeren-tempel.net> Date: Tue, 9 Jun 2026 14:23:28 +0200 Make it easier to configure the name of the QBE binary While it is already possible to configure the as(1) and ld(1) binary name through C macros, the QBE binary name is itself currently hardcoded. However, for distribution following the functional software deployment model (e.g., Guix or Nix), it is useful to also make the name of the QBE binary configurable. This is implemented here through the addition of a QBEBIN macro. ab709ce7d4bc60982fa69b0956e58e9330892f2c 2026-06-09T06:28:42Z 2026-06-09T06:28:42Z cc1: Minor changes in comments Roberto E. Vargas Caballero k0ga@shike2.net commit ab709ce7d4bc60982fa69b0956e58e9330892f2c parent 5a6e26e28744a0fa4efe9f6e032bd40c647b3749 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 9 Jun 2026 08:28:42 +0200 cc1: Minor changes in comments 5a6e26e28744a0fa4efe9f6e032bd40c647b3749 2026-06-03T04:39:45Z 2026-06-05T08:09:30Z cc1: Try parsing specifiers after struct/union/enum Zhaoming Luo zhml@posteo.com commit 5a6e26e28744a0fa4efe9f6e032bd40c647b3749 parent a7a08bb3d51b852995346c96d94265ea936731e5 Author: Zhaoming Luo <zhml@posteo.com> Date: Wed, 3 Jun 2026 04:39:45 +0000 cc1: Try parsing specifiers after struct/union/enum In specifier(), the type is returned after parsing the struct/union/enum specifier. Therefore, the compile will fail with the declaration like: `struct S const s;`. However, according to the syntax of `declaration-specifiers` in c99 spec 6.7, it's accpectable to have other specifiers or qualifiers following the struct/union/enum specifier, which is a type specifier. To follow the c99 spec, continue looking for other specifiers or qualifiers after a struct/union/enum specifier rather than return immediately. a7a08bb3d51b852995346c96d94265ea936731e5 2026-06-05T07:38:00Z 2026-06-05T07:38:00Z tests/cc: Add 0042-struct-enum error test Roberto E. Vargas Caballero k0ga@shike2.net commit a7a08bb3d51b852995346c96d94265ea936731e5 parent 5136c8c992d0d99e593e447a0e74aa79dc50fb18 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 5 Jun 2026 09:38:00 +0200 tests/cc: Add 0042-struct-enum error test This test is marked as TODO because the error recovery mechanism is not working correctly as it was already known. Every of the error conditions of the test were manually tested. 5136c8c992d0d99e593e447a0e74aa79dc50fb18 2026-06-03T09:04:49Z 2026-06-03T09:04:49Z cc1: Fix bug introduced in 15b64d5 Roberto E. Vargas Caballero k0ga@shike2.net commit 5136c8c992d0d99e593e447a0e74aa79dc50fb18 parent 15b64d5d2636103fdeafea92ea7886dbd23c6574 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 3 Jun 2026 11:04:49 +0200 cc1: Fix bug introduced in 15b64d5 The symbol related to the tag is symtag and not sym which ius used later and it is not initialized at this point. Co-authored-by: Zhaoming Luo <zhml@posteo.com> 15b64d5d2636103fdeafea92ea7886dbd23c6574 2026-06-02T11:18:09Z 2026-06-02T13:32:13Z cc1: Error when no struct identifier and '{' Zhaoming Luo zhml@posteo.com commit 15b64d5d2636103fdeafea92ea7886dbd23c6574 parent 5d10a2436b4df6c82723bb7174451ab267512155 Author: Zhaoming Luo <zhml@posteo.com> Date: Tue, 2 Jun 2026 11:18:09 +0000 cc1: Error when no struct identifier and '{' In c99 spec 6.7.2.1.1 `struct-or-union-specifier`, when there is an identifier following `struct-or-union`, it's optional to have `{ struct-declaration-list }` after the identifier; if the identifier does not exist, there must be `{ struct-declaration-list }`. In structdcl(), in the error case where the token after `struct-or-union` is neither an identifier nor '{', a placeholder type is created in newtag() and returned. Compiling 'struct const s { int v; };' gives error message: ``` test.c:1: error: expected ';' before 'const' test.c:1: error: expected ';' before '{' .. test.c:1: error: expected ';' before '{' too many errors ``` Error when the token after `struct-or-union` is neither an identifier nor '{'. The error message will be more understandable: ``` test.c:1: error: unexpected 'const' ``` 5d10a2436b4df6c82723bb7174451ab267512155 2026-06-01T21:08:14Z 2026-06-01T21:08:14Z build/libc: Recover the definition of CPPINCLUDES Roberto E. Vargas Caballero k0ga@shike2.net commit 5d10a2436b4df6c82723bb7174451ab267512155 parent 4db66b3e48d2821ea034c2cc9e233594695872ca Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Mon, 1 Jun 2026 23:08:14 +0200 build/libc: Recover the definition of CPPINCLUDES While this definition is not needed anymore because we use scc to build the libc, not having it creates problems in the config-musl configuration, which would try to use the musl headers with the scc libc. Adding these additional -I is odd, but not building the libc in the case of musl creates other problems, because the proto files used in the install target require the different libcs to be built and present in the lib directory. 4db66b3e48d2821ea034c2cc9e233594695872ca 2026-06-01T18:21:08Z 2026-06-01T18:21:08Z doc: Update QBE version to 1.3 Roberto E. Vargas Caballero k0ga@shike2.net commit 4db66b3e48d2821ea034c2cc9e233594695872ca parent cd2e378821e5e5f86215643e87a6b806a8b54492 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Mon, 1 Jun 2026 20:21:08 +0200 doc: Update QBE version to 1.3 QBE finally made a release that includes the common storeage and we don't have to pointer to a development commit anymore. cd2e378821e5e5f86215643e87a6b806a8b54492 2026-05-29T16:56:57Z 2026-05-29T16:56:57Z tests/cc: Use make to build the programs Roberto E. Vargas Caballero k0ga@shike2.net commit cd2e378821e5e5f86215643e87a6b806a8b54492 parent f60bf2a21373462c9b7636b9546a6574c9db7f5f Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 29 May 2026 18:56:57 +0200 tests/cc: Use make to build the programs This simplifies the shell script and the Makefile. f60bf2a21373462c9b7636b9546a6574c9db7f5f 2026-05-29T16:33:39Z 2026-05-29T16:33:39Z libc/stdio: Reorder functions in header Roberto E. Vargas Caballero k0ga@shike2.net commit f60bf2a21373462c9b7636b9546a6574c9db7f5f parent 00d2b697dbd14b05c12e05fa1b50fa8d9fa1fbd4 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 29 May 2026 18:33:39 +0200 libc/stdio: Reorder functions in header 00d2b697dbd14b05c12e05fa1b50fa8d9fa1fbd4 2026-05-29T12:34:38Z 2026-05-29T12:34:38Z tests/libc: Add -s to make to be silent Roberto E. Vargas Caballero k0ga@shike2.net commit 00d2b697dbd14b05c12e05fa1b50fa8d9fa1fbd4 parent d9b6c4384a9995d70c3bfa352d343a84c7491059 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 29 May 2026 14:34:38 +0200 tests/libc: Add -s to make to be silent d9b6c4384a9995d70c3bfa352d343a84c7491059 2026-05-29T12:34:10Z 2026-05-29T12:34:10Z tests/libc: Add 0099-tmpnam Roberto E. Vargas Caballero k0ga@shike2.net commit d9b6c4384a9995d70c3bfa352d343a84c7491059 parent 33141db27c405bbec69efaa2808b502d091c36e8 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 29 May 2026 14:34:10 +0200 tests/libc: Add 0099-tmpnam 33141db27c405bbec69efaa2808b502d091c36e8 2026-05-29T11:19:29Z 2026-05-29T11:19:29Z Merge remote-tracking branch 'origin/master' Roberto E. Vargas Caballero k0ga@shike2.net commit 33141db27c405bbec69efaa2808b502d091c36e8 parent 36a1eef62de6d85631e2f6ae728620dec34454cc Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 29 May 2026 13:19:29 +0200 Merge remote-tracking branch 'origin/master' 74119bd8d7b2d8a91b2b2e5bd7984ce5377402ab 2026-05-29T11:16:32Z 2026-05-29T11:16:32Z cc2/qbe: Emit an initial body label Roberto E. Vargas Caballero k0ga@shike2.net commit 74119bd8d7b2d8a91b2b2e5bd7984ce5377402ab parent 47b81d4c6f906155f23054757a85c829aff80c40 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 29 May 2026 13:16:32 +0200 cc2/qbe: Emit an initial body label This label is needed because otherwise branching to the label at the beginning og the function generates an error in qbe: invalid jump to the start block 36a1eef62de6d85631e2f6ae728620dec34454cc 2026-05-28T09:39:48Z 2026-05-29T10:11:18Z tests/libc: Use timeout Roberto E. Vargas Caballero k0ga@shike2.net commit 36a1eef62de6d85631e2f6ae728620dec34454cc parent 3a1198d1a58ea4e4aff5a3c127b9235e14e13c47 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Thu, 28 May 2026 11:39:48 +0200 tests/libc: Use timeout While the timeout utility became standard only in POSIX 2024 it was available for many years in every UNIX alike system and dealing directly wit signals and timeout in the shell it is not easy and it was generating problems in OpenBSD. 47b81d4c6f906155f23054757a85c829aff80c40 2026-05-28T08:19:01Z 2026-05-28T08:19:01Z cc1: Don't add addional spaces in macro arguments Roberto E. Vargas Caballero k0ga@shike2.net commit 47b81d4c6f906155f23054757a85c829aff80c40 parent a64383b5e55ca6d2da9cf4039bd8926222a7d9b9 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Thu, 28 May 2026 10:19:01 +0200 cc1: Don't add addional spaces in macro arguments Cpp was adding spajce between tokens composing a macro argument. This space was needed to avoid undesired concatenations between adjancents tokens, like for example identifiers, but it was breaking some cases of the stringize operator because it wan adding spaces in the string where they were not in the macro argument. The scc tokenizer does not preserves spaces, and this makes a bit difficult to know when to insert spaces for this case, so the simpler solution is just to add a new variable that stores the last space seen in the tokenizer, and lets the caller to manage it as desired because the majority of the code doesn't matter about it. a64383b5e55ca6d2da9cf4039bd8926222a7d9b9 2026-05-25T22:29:39Z 2026-05-25T22:31:59Z cc1: Don't escape \ out of "" or '' Roberto E. Vargas Caballero k0ga@shike2.net commit a64383b5e55ca6d2da9cf4039bd8926222a7d9b9 parent e22d82e7c5eff9eb5b0390e06b7df8e11c7e4599 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 26 May 2026 00:29:39 +0200 cc1: Don't escape \ out of "" or '' e22d82e7c5eff9eb5b0390e06b7df8e11c7e4599 2026-05-25T08:54:03Z 2026-05-25T08:54:03Z test/cc: Add more cases to 0273-cpp Roberto E. Vargas Caballero k0ga@shike2.net commit e22d82e7c5eff9eb5b0390e06b7df8e11c7e4599 parent ef83e049a0f548e2ca4c1bb7f8d4fae71a2c8678 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Mon, 25 May 2026 10:54:03 +0200 test/cc: Add more cases to 0273-cpp ef83e049a0f548e2ca4c1bb7f8d4fae71a2c8678 2026-05-25T08:41:49Z 2026-05-25T08:41:49Z tests/cc: Use SCC for the test driven compiler Roberto E. Vargas Caballero k0ga@shike2.net commit ef83e049a0f548e2ca4c1bb7f8d4fae71a2c8678 parent e662a3a5d5922a6f3925731ff52363834e1c9d4d Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Mon, 25 May 2026 10:41:49 +0200 tests/cc: Use SCC for the test driven compiler This helps when generating coverage information. e662a3a5d5922a6f3925731ff52363834e1c9d4d 2026-05-25T08:40:29Z 2026-05-25T08:40:29Z cc1: Add \r to cppspaces() Roberto E. Vargas Caballero k0ga@shike2.net commit e662a3a5d5922a6f3925731ff52363834e1c9d4d parent 9dfcc04c761ad5d218a1178795398883c0925aba Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Mon, 25 May 2026 10:40:29 +0200 cc1: Add \r to cppspaces() While this is not required (accepted?) by the standard, ignoring them would help in cases where source code from Win is used in Unix systems. 9dfcc04c761ad5d218a1178795398883c0925aba 2026-05-22T09:59:54Z 2026-05-22T10:13:54Z tests/cc: Add 0273-cpp.c Roberto E. Vargas Caballero k0ga@shike2.net commit 9dfcc04c761ad5d218a1178795398883c0925aba parent 328388439b2db162f7dedb75db497509131cc745 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 22 May 2026 11:59:54 +0200 tests/cc: Add 0273-cpp.c 328388439b2db162f7dedb75db497509131cc745 2026-05-22T09:26:14Z 2026-05-22T09:30:04Z cc1: Add cppspaces() Roberto E. Vargas Caballero k0ga@shike2.net commit 328388439b2db162f7dedb75db497509131cc745 parent 693af8c7f3cef75f855092950a8601e25714a23d Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 22 May 2026 11:26:14 +0200 cc1: Add cppspaces() The rules about how the preprocssor must handle spaces are a bit unspecified in the standard. The paragraph 6.4.3 says: Preprocessing tokens can be separated by white space; this consists of comments (described later), or white-space characters (space, horizontal tab, new-line, vertical tab, and form-feed), or both but 6.10.5 says: The only white-space characters that shall appear between preprocessing tokens within a preprocessing directive (from just after the introducing # preprocessing token through just before the terminating new-line character) are space and horizontal-tab (including spaces that have replaced comments or possibly other white-space characters in translation phase 3). so, it seems that this paragraph seems to limit the spaces in preprocessing directives to only ' ' and '\t', but 5.1.1.2.1 says about translation phase 3: Each comment is replaced by one space character. New-line characters are retained. Whether each nonempty sequence of white-space characters other than new-line is retained or replaced by one space character is implementation-defined. so, as 6.10.5 accepts the changes possibily done in translation phase 3, then we can decide to accept all the white spaces in preprocessor directives. To make all this stuff simpler we just deal all the white spaces in the same way using the freedom provided by 5.1.1.2.1, and we add a new cppspace() function to avoid problems with ctype isspace() because there are cases where valid programs can pass characters over 127 and being processed by these calls, for example: #define a(x) #x a(word) `word` can contain any character, including utf8 characters over 127 and still being a valid C program, so using isspaces there can be problematic. While we don't care so much about having problems with invalid inputs (as in these cases the result is undefined) it is different in the case of vaild inputs. 693af8c7f3cef75f855092950a8601e25714a23d 2026-05-22T09:06:58Z 2026-05-22T09:24:03Z cc1: Consolidate spaces in stringize operator Roberto E. Vargas Caballero k0ga@shike2.net commit 693af8c7f3cef75f855092950a8601e25714a23d parent f2553ae4bbaeabd5c6ecee8d2b0aa1c7e1f3f16f Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 22 May 2026 11:06:58 +0200 cc1: Consolidate spaces in stringize operator The rules about spaces in stringize operators are specified in 6.10.3.2 of the C99 spec, and it defines that any sequence of white space between preprocessor tokens must be consolidated to a single white space character, but the white characters in strings or character constants must be preserved. In the same way, " and \ must be escaped. f2553ae4bbaeabd5c6ecee8d2b0aa1c7e1f3f16f 2026-05-22T08:49:53Z 2026-05-22T08:49:53Z cc1: Accept spaces after stringize operator Roberto E. Vargas Caballero k0ga@shike2.net commit f2553ae4bbaeabd5c6ecee8d2b0aa1c7e1f3f16f parent 5e1de781e494bc498563179f42fa19355816b29b Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 22 May 2026 10:49:53 +0200 cc1: Accept spaces after stringize operator Spaces after # operator in macro definitions must be ignored. 5e1de781e494bc498563179f42fa19355816b29b 2026-05-21T09:12:36Z 2026-05-21T09:12:36Z cc1: Fix cpp parameter space strimming Roberto E. Vargas Caballero k0ga@shike2.net commit 5e1de781e494bc498563179f42fa19355816b29b parent ebcda96d082604b10e93af543fd719ed037f4746 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Thu, 21 May 2026 11:12:36 +0200 cc1: Fix cpp parameter space strimming The trailing white spaces where not removed because we were always checking the ending \0 instead of the last character of the string. ebcda96d082604b10e93af543fd719ed037f4746 2026-05-20T08:01:37Z 2026-05-20T08:01:37Z cc1: Use isspace() around concat operator Roberto E. Vargas Caballero k0ga@shike2.net commit ebcda96d082604b10e93af543fd719ed037f4746 parent 1e0f1124de63a6ef2e30314484fca2e2f60da4ad Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 20 May 2026 10:01:37 +0200 cc1: Use isspace() around concat operator The spec indicates that a preprocessor white space is any of ' ', \t, \f, \v and \n. As we use the default C locale that is equivalent to use isspace(), which is already used in other places of the cpp, even when there are (very rare) cases where it could produce problems. 1e0f1124de63a6ef2e30314484fca2e2f60da4ad 2026-05-12T10:55:38Z 2026-05-12T10:57:38Z build: Continue with the migration to scc Roberto E. Vargas Caballero k0ga@shike2.net commit 1e0f1124de63a6ef2e30314484fca2e2f60da4ad parent 783ac157e892d418efb54c7c3b4e76e2330f65d9 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 12 May 2026 12:55:38 +0200 build: Continue with the migration to scc This commits continue with the migration to use scc for the libc and for the tests. It also means removing the gcc-scc tool that used to be used to test the libc before scc was able to complie it. In case of being needed it can be recovered from the history. 783ac157e892d418efb54c7c3b4e76e2330f65d9 2026-05-12T10:51:05Z 2026-05-12T10:51:05Z build: Reorder includes in gcov profile Roberto E. Vargas Caballero k0ga@shike2.net commit 783ac157e892d418efb54c7c3b4e76e2330f65d9 parent a27201f2a9b36722cc7a81b31b0e6ae0621078bb Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 12 May 2026 12:51:05 +0200 build: Reorder includes in gcov profile It allows to override variables defined in the gnu profile a27201f2a9b36722cc7a81b31b0e6ae0621078bb 2026-05-12T10:18:02Z 2026-05-12T10:18:02Z tests/libc: Adjust FOPEN_MAX in 0098-tmpfil Roberto E. Vargas Caballero k0ga@shike2.net commit a27201f2a9b36722cc7a81b31b0e6ae0621078bb parent d681ea0ce2e1903f5047140fb3bcb6da1dc0e673 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 12 May 2026 12:18:02 +0200 tests/libc: Adjust FOPEN_MAX in 0098-tmpfil The value of FOPEN_MAX includes stdin, stdout and stderr so it is impossible to open FOPEN_MAX new streams. d681ea0ce2e1903f5047140fb3bcb6da1dc0e673 2026-05-12T10:15:06Z 2026-05-12T10:15:06Z libc/stdio: Fix tmpnam() Roberto E. Vargas Caballero k0ga@shike2.net commit d681ea0ce2e1903f5047140fb3bcb6da1dc0e673 parent 6c5c5ab6a9adc01a81abbc1cc6e2b26d0b9a53fb Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 12 May 2026 12:15:06 +0200 libc/stdio: Fix tmpnam() The logic to find the digits to increment was wrong and it returned FALSE always. 6c5c5ab6a9adc01a81abbc1cc6e2b26d0b9a53fb 2026-05-12T09:27:31Z 2026-05-12T09:28:44Z tests/cc: Remove entries from .gitignore Roberto E. Vargas Caballero k0ga@shike2.net commit 6c5c5ab6a9adc01a81abbc1cc6e2b26d0b9a53fb parent d0c8ee4efa225ebecb471bef5bcbe3a7033de81c Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 12 May 2026 11:27:31 +0200 tests/cc: Remove entries from .gitignore We don't use test names for this test suite. d0c8ee4efa225ebecb471bef5bcbe3a7033de81c 2026-05-06T19:33:16Z 2026-05-12T09:28:44Z build/gcov: Override SCC Roberto E. Vargas Caballero k0ga@shike2.net commit d0c8ee4efa225ebecb471bef5bcbe3a7033de81c parent 937941341d13f7fd6da062d332faf4a1be4edd04 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 21:33:16 +0200 build/gcov: Override SCC When the gcov toolchain is used then we don't want to use scc for the tests, because that removes any possibility of extracting coverage information. We still have problems with the coverage of the libc, because when we use gcc then we use the gcc libc. 937941341d13f7fd6da062d332faf4a1be4edd04 2026-05-12T07:45:02Z 2026-05-12T07:45:02Z tests/make: Add 0110-loop Roberto E. Vargas Caballero k0ga@shike2.net commit 937941341d13f7fd6da062d332faf4a1be4edd04 parent 95b1d6c4ae74328c31bc2a3bdc80db53886bedea Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 12 May 2026 09:45:02 +0200 tests/make: Add 0110-loop 95b1d6c4ae74328c31bc2a3bdc80db53886bedea 2026-05-12T07:40:59Z 2026-05-12T07:43:06Z make: Use recursion to find circular dependencies Roberto E. Vargas Caballero k0ga@shike2.net commit 95b1d6c4ae74328c31bc2a3bdc80db53886bedea parent fddf43508290bc39144364d09e641f3bba7ef095 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 12 May 2026 09:40:59 +0200 make: Use recursion to find circular dependencies fddf43508290bc39144364d09e641f3bba7ef095 2026-05-12T07:32:04Z 2026-05-12T07:32:04Z tests/cc: Add 0041-iconst to the test list Roberto E. Vargas Caballero k0ga@shike2.net commit fddf43508290bc39144364d09e641f3bba7ef095 parent 720db27ed2d65d714ad11f96b3368c7a83b2ac11 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Tue, 12 May 2026 09:32:04 +0200 tests/cc: Add 0041-iconst to the test list 720db27ed2d65d714ad11f96b3368c7a83b2ac11 2026-05-11T19:01:59Z 2026-05-11T19:01:59Z tests/cc: Update scc path in update.sh Roberto E. Vargas Caballero k0ga@shike2.net commit 720db27ed2d65d714ad11f96b3368c7a83b2ac11 parent aae32c7523883c103a8bdb847549345388563c54 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Mon, 11 May 2026 21:01:59 +0200 tests/cc: Update scc path in update.sh The shell script update.sh is a helper to automatize getting the error messages from scc, and for that reason it should point to the scc produced by the build and not the one from the PATH. aae32c7523883c103a8bdb847549345388563c54 2026-05-11T19:01:27Z 2026-05-11T19:01:27Z tests/cc: Add execute/0041-iconst Roberto E. Vargas Caballero k0ga@shike2.net commit aae32c7523883c103a8bdb847549345388563c54 parent 33787455afaea0e22d89176ede170941766a9bd4 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Mon, 11 May 2026 21:01:27 +0200 tests/cc: Add execute/0041-iconst 33787455afaea0e22d89176ede170941766a9bd4 2026-05-11T18:55:40Z 2026-05-11T18:55:40Z cc1: Check type of array designator index Roberto E. Vargas Caballero k0ga@shike2.net commit 33787455afaea0e22d89176ede170941766a9bd4 parent ea6d8cf4e6d83ca32ce98443dc939ec897daf6b7 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Mon, 11 May 2026 20:55:40 +0200 cc1: Check type of array designator index The expression between [ ] must an integer constant expression, and the function iconstexpr() returns NULL in that case and it has to be checked to give the proper error message. ea6d8cf4e6d83ca32ce98443dc939ec897daf6b7 2026-05-11T08:16:52Z 2026-05-11T08:16:52Z Merge remote-tracking branch 'origin/master' Roberto E. Vargas Caballero k0ga@shike2.net commit ea6d8cf4e6d83ca32ce98443dc939ec897daf6b7 parent 334fc49dab766c427e4ea98719cbaf869e60b6c9 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Mon, 11 May 2026 10:16:52 +0200 Merge remote-tracking branch 'origin/master' 334fc49dab766c427e4ea98719cbaf869e60b6c9 2026-05-11T08:04:31Z 2026-05-11T08:04:31Z ranlib: Remove offset and oldsiz globals Roberto E. Vargas Caballero k0ga@shike2.net commit 334fc49dab766c427e4ea98719cbaf869e60b6c9 parent 0dcd0d571ff51bbc87adcec9531f6a21707823d6 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Mon, 11 May 2026 10:04:31 +0200 ranlib: Remove offset and oldsiz globals How these variables were used was a bit weirdd, since they could just be parameters passed to newsymbol(), and avoid the delta calculation storing only offset without any index in the first stage. That makes trivial to do the second phase. 3a1198d1a58ea4e4aff5a3c127b9235e14e13c47 2026-05-08T19:21:41Z 2026-05-08T19:21:41Z libc/stdio: Use wb+ for tmpfile() Roberto E. Vargas Caballero k0ga@shike2.net commit 3a1198d1a58ea4e4aff5a3c127b9235e14e13c47 parent 0dcd0d571ff51bbc87adcec9531f6a21707823d6 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 21:21:41 +0200 libc/stdio: Use wb+ for tmpfile() It is required by the C99 spec, but in our case there is not difference between text and binary streams anyway. 0dcd0d571ff51bbc87adcec9531f6a21707823d6 2026-05-08T18:05:20Z 2026-05-08T18:05:20Z build/libmach: Add elf header dependencies Roberto E. Vargas Caballero k0ga@shike2.net commit 0dcd0d571ff51bbc87adcec9531f6a21707823d6 parent d8242493b4b9b1b20e2a22403eec1f550c6fed14 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 20:05:20 +0200 build/libmach: Add elf header dependencies d8242493b4b9b1b20e2a22403eec1f550c6fed14 2026-05-08T18:00:32Z 2026-05-08T18:00:32Z libmach: Remove unused elf64.h header Roberto E. Vargas Caballero k0ga@shike2.net commit d8242493b4b9b1b20e2a22403eec1f550c6fed14 parent a4c40d95dec037a875469cddc7987c8d3783c86a Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 20:00:32 +0200 libmach: Remove unused elf64.h header a4c40d95dec037a875469cddc7987c8d3783c86a 2026-05-08T17:44:40Z 2026-05-08T17:57:40Z libmach: Unify coff32getidx and elfgetidx Roberto E. Vargas Caballero k0ga@shike2.net commit a4c40d95dec037a875469cddc7987c8d3783c86a parent 260689938154916eebc6d7002c81f001a8771ab3 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 19:44:40 +0200 libmach: Unify coff32getidx and elfgetidx 260689938154916eebc6d7002c81f001a8771ab3 2026-05-08T17:44:40Z 2026-05-08T17:44:40Z libmach: Unify coff32setidx and elfsetidx Roberto E. Vargas Caballero k0ga@shike2.net commit 260689938154916eebc6d7002c81f001a8771ab3 parent fc170495f7e645ac620e28c546cdd7401d1668c7 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 19:44:40 +0200 libmach: Unify coff32setidx and elfsetidx fc170495f7e645ac620e28c546cdd7401d1668c7 2026-05-08T17:32:01Z 2026-05-08T17:32:01Z build/libc: Use scc-ranlib Roberto E. Vargas Caballero k0ga@shike2.net commit fc170495f7e645ac620e28c546cdd7401d1668c7 parent 887b0bef5f76997de2bdbd2a91168dde357821d1 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 19:32:01 +0200 build/libc: Use scc-ranlib 887b0bef5f76997de2bdbd2a91168dde357821d1 2026-05-08T17:27:24Z 2026-05-08T17:27:24Z ranlib: Use 2 phases writing the index Roberto E. Vargas Caballero k0ga@shike2.net commit 887b0bef5f76997de2bdbd2a91168dde357821d1 parent 5cdbd266c31962ec9ebcef0415d2f104b209cddb Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 19:27:24 +0200 ranlib: Use 2 phases writing the index When the different offsets are calculated they are based in the size of the existing index if there was any index, but if the new index has a different size then the offset are misplaced. In order to fix this issue we have to record the size of the existing index file, generate the new index file, and apply fixups to every offset to adjust it to the actual offset in the final archive. 5cdbd266c31962ec9ebcef0415d2f104b209cddb 2026-05-08T17:08:59Z 2026-05-08T17:08:59Z ranlib: Use offset to member headers Roberto E. Vargas Caballero k0ga@shike2.net commit 5cdbd266c31962ec9ebcef0415d2f104b209cddb parent c1e1df2ac4a400eae9b97a01106a95cc927f83db Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 19:08:59 +0200 ranlib: Use offset to member headers We were generating an index table of pointers to the content of the object files, but ld expects the pointers to the ar headers which contain required information like the size of the object file. c1e1df2ac4a400eae9b97a01106a95cc927f83db 2026-05-08T16:52:07Z 2026-05-08T16:52:07Z libmach: Use 32BE for index in elf Roberto E. Vargas Caballero k0ga@shike2.net commit c1e1df2ac4a400eae9b97a01106a95cc927f83db parent 6abf674372bf77c7bcd7ed762b3791c67b7fdf47 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 18:52:07 +0200 libmach: Use 32BE for index in elf Archive of elf always use offset of 4 bytes and being big endian independently of the architecture used in the object files. 6abf674372bf77c7bcd7ed762b3791c67b7fdf47 2026-05-08T16:44:35Z 2026-05-08T16:44:35Z ranlib: Fix detection of previous index Roberto E. Vargas Caballero k0ga@shike2.net commit 6abf674372bf77c7bcd7ed762b3791c67b7fdf47 parent e9fd2f28fb1200643f668d500c1239a4154d0cb1 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 18:44:35 +0200 ranlib: Fix detection of previous index The strncmp was wrong because after the end of the member name the ar format has spaces that are not going to match with the end of string. Also, it didn't consider the padding of ar members which has to be 2 bytes. e9fd2f28fb1200643f668d500c1239a4154d0cb1 2026-05-08T15:09:40Z 2026-05-08T15:09:40Z libmach: Remove unused variable Roberto E. Vargas Caballero k0ga@shike2.net commit e9fd2f28fb1200643f668d500c1239a4154d0cb1 parent 166e28278d2647af887159e78a28cae8e45fa381 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 17:09:40 +0200 libmach: Remove unused variable 166e28278d2647af887159e78a28cae8e45fa381 2026-05-08T14:17:13Z 2026-05-08T14:31:06Z libmach: Implement setindex() for elf Roberto E. Vargas Caballero k0ga@shike2.net commit 166e28278d2647af887159e78a28cae8e45fa381 parent c3fa57c8e3433a5a3d22b558f97e959fd129d613 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 16:17:13 +0200 libmach: Implement setindex() for elf c3fa57c8e3433a5a3d22b558f97e959fd129d613 2026-05-08T14:14:20Z 2026-05-08T14:22:10Z libc: Remove duplicated _open Roberto E. Vargas Caballero k0ga@shike2.net commit c3fa57c8e3433a5a3d22b558f97e959fd129d613 parent 6212cd97ef3b5311a8245131e8bf5f9957e4fd67 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 16:14:20 +0200 libc: Remove duplicated _open _open can be implemented with a syscall or with a wrapper using _openat. Some versions of linux only has _openat and it is required to use _openat to implement _open, but in many other systems like in openbsd and netbsd you have a _open syscall and having both symbols in the archive makes impredictable which symbol is used. 6212cd97ef3b5311a8245131e8bf5f9957e4fd67 2026-05-08T13:34:16Z 2026-05-08T14:22:03Z libmach: Encode number of bits in OBJ() Roberto E. Vargas Caballero k0ga@shike2.net commit 6212cd97ef3b5311a8245131e8bf5f9957e4fd67 parent 73b42fa96c7f6580d0cc18a4611c620e3ec28e44 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 15:34:16 +0200 libmach: Encode number of bits in OBJ() Some formats have different versions based in being a 32 or 64 bit version, and deriving it from the arch has corner cases and it requires continous maintainance. 73b42fa96c7f6580d0cc18a4611c620e3ec28e44 2026-05-08T12:03:50Z 2026-05-08T14:21:53Z libmach: Make coff32csetidx generic Roberto E. Vargas Caballero k0ga@shike2.net commit 73b42fa96c7f6580d0cc18a4611c620e3ec28e44 parent 87395a88f21b0102683b3d1ce8754a5f6fa6cf5a Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 14:03:50 +0200 libmach: Make coff32csetidx generic The function coff32csetidx() can be used for elf too because they share the index file format. A.out had a different layout, but as we don't support it yet, we can just use the name setidx32(). 87395a88f21b0102683b3d1ce8754a5f6fa6cf5a 2026-05-08T10:10:45Z 2026-05-08T10:23:21Z as: Remove debug abort() Roberto E. Vargas Caballero k0ga@shike2.net commit 87395a88f21b0102683b3d1ce8754a5f6fa6cf5a parent 70da2bb8081e70c1ee0f2d9a90104356b61e6b9a Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 12:10:45 +0200 as: Remove debug abort() The call to abort() was a leftover from a previous change where we added support for folding constant labels. We still have cases where we can't deal with non constant expressions that would require support from relocations. 70da2bb8081e70c1ee0f2d9a90104356b61e6b9a 2026-05-08T07:57:17Z 2026-05-08T07:57:17Z Merge remote-tracking branch 'origin/master' Roberto E. Vargas Caballero k0ga@shike2.net commit 70da2bb8081e70c1ee0f2d9a90104356b61e6b9a parent 69a6dd3cdb185af347d93e03f82e9f303575843f Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 09:57:17 +0200 Merge remote-tracking branch 'origin/master' 69a6dd3cdb185af347d93e03f82e9f303575843f 2026-05-08T07:54:28Z 2026-05-08T07:54:28Z ranlib: Ignore undefine references Roberto E. Vargas Caballero k0ga@shike2.net commit 69a6dd3cdb185af347d93e03f82e9f303575843f parent 49ad9073f0ae0db7c459cba3e41dfccaa95c7abe Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 09:54:28 +0200 ranlib: Ignore undefine references When building an index of symbol definitions undefine references don't help so much and with the current code they were generating wrong redefinition errors. 49ad9073f0ae0db7c459cba3e41dfccaa95c7abe 2026-05-08T07:52:11Z 2026-05-08T07:52:11Z ranlib: Fix offset calculation Roberto E. Vargas Caballero k0ga@shike2.net commit 49ad9073f0ae0db7c459cba3e41dfccaa95c7abe parent 77f7bee754210661f4bcf5cdcdebdb3058bb8a8b Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 8 May 2026 09:52:11 +0200 ranlib: Fix offset calculation After reading th header of an archive member the file pointer is already located at the end of the header and armember returns the offset from the beginning of the archive header, so we have to use the cur variable instead of the offset in the file pointer. 117094fdd583ac0907bef5e80e27f23a84847735 2026-05-07T08:38:17Z 2026-05-07T08:38:17Z tests/libc: Add 0098-tmpfil Roberto E. Vargas Caballero k0ga@shike2.net commit 117094fdd583ac0907bef5e80e27f23a84847735 parent 6f15a112f5ed7705f322845bdb7c9914d191dbc7 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Thu, 7 May 2026 10:38:17 +0200 tests/libc: Add 0098-tmpfil 6f15a112f5ed7705f322845bdb7c9914d191dbc7 2026-05-06T19:24:55Z 2026-05-06T19:24:55Z build: Fix libscc-$(DRIVER).a dependency Roberto E. Vargas Caballero k0ga@shike2.net commit 6f15a112f5ed7705f322845bdb7c9914d191dbc7 parent e62db67e3da88d0e908dd58d9e7688c1c0791bc1 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 21:24:55 +0200 build: Fix libscc-$(DRIVER).a dependency e62db67e3da88d0e908dd58d9e7688c1c0791bc1 2026-05-06T19:19:35Z 2026-05-06T19:19:35Z build: Cover Add coverage to top Makefile Roberto E. Vargas Caballero k0ga@shike2.net commit e62db67e3da88d0e908dd58d9e7688c1c0791bc1 parent f32b47792675b766275a003f4a644973d72f89e7 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 21:19:35 +0200 build: Cover Add coverage to top Makefile The coverage target is defined in the gcov toolchain, but it needs to be populated in the top level Makefile in order to be used. f32b47792675b766275a003f4a644973d72f89e7 2026-05-06T19:15:55Z 2026-05-06T19:15:55Z libc/cc: Minor fixes Roberto E. Vargas Caballero k0ga@shike2.net commit f32b47792675b766275a003f4a644973d72f89e7 parent b4bb95aaed9b85dc43d293e2c7310e81f0092005 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 21:15:55 +0200 libc/cc: Minor fixes b4bb95aaed9b85dc43d293e2c7310e81f0092005 2026-05-06T19:07:48Z 2026-05-06T19:07:48Z libc/stdio: Use uinptr_t instead of -1 pointers Roberto E. Vargas Caballero k0ga@shike2.net commit b4bb95aaed9b85dc43d293e2c7310e81f0092005 parent 10686ff83b100fbf8f51b136fe5b351be6014226 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 21:07:48 +0200 libc/stdio: Use uinptr_t instead of -1 pointers Using (char *)-1 - s should work in the majority of systems and or compilers, but using uinptr_t and UINTPTR_MAX makes the code cleaner and allows to remove the comment. 10686ff83b100fbf8f51b136fe5b351be6014226 2026-05-06T18:58:19Z 2026-05-06T18:59:25Z tests/libc: Add 0097-fops Roberto E. Vargas Caballero k0ga@shike2.net commit 10686ff83b100fbf8f51b136fe5b351be6014226 parent 442f7a3a7ae3ad6412dbee2b688a85bef45a89f7 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 20:58:19 +0200 tests/libc: Add 0097-fops 442f7a3a7ae3ad6412dbee2b688a85bef45a89f7 2026-05-06T18:54:32Z 2026-05-06T18:59:25Z tests/libc: Remove debug comment from 0096-div Roberto E. Vargas Caballero k0ga@shike2.net commit 442f7a3a7ae3ad6412dbee2b688a85bef45a89f7 parent 77f7bee754210661f4bcf5cdcdebdb3058bb8a8b Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 20:54:32 +0200 tests/libc: Remove debug comment from 0096-div 77f7bee754210661f4bcf5cdcdebdb3058bb8a8b 2026-05-06T18:28:43Z 2026-05-06T18:28:43Z build/libc: Use scc ar Roberto E. Vargas Caballero k0ga@shike2.net commit 77f7bee754210661f4bcf5cdcdebdb3058bb8a8b parent f1fd6cc9a7ab7a9e2154674f5b59118b58727dad Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 20:28:43 +0200 build/libc: Use scc ar f1fd6cc9a7ab7a9e2154674f5b59118b58727dad 2026-05-06T13:46:38Z 2026-05-06T13:46:38Z tests/libc: Fix expected output Roberto E. Vargas Caballero k0ga@shike2.net commit f1fd6cc9a7ab7a9e2154674f5b59118b58727dad parent abb580ab3b5c38c0a59ee61220dbada9147bf615 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 15:46:38 +0200 tests/libc: Fix expected output abb580ab3b5c38c0a59ee61220dbada9147bf615 2026-05-06T11:14:28Z 2026-05-06T11:22:58Z Merge remote-tracking branch 'origin/master' Roberto E. Vargas Caballero k0ga@shike2.net commit abb580ab3b5c38c0a59ee61220dbada9147bf615 parent d2d1660217ff0a583f1d5736be450ac97a8d8035 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 13:14:28 +0200 Merge remote-tracking branch 'origin/master' d2d1660217ff0a583f1d5736be450ac97a8d8035 2026-05-06T11:13:46Z 2026-05-06T11:22:58Z tests/libc: Add 0096-div Roberto E. Vargas Caballero k0ga@shike2.net commit d2d1660217ff0a583f1d5736be450ac97a8d8035 parent d6d570e027558233db7d49102557ad4865845e76 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 13:13:46 +0200 tests/libc: Add 0096-div 6da80aa96eaf48cd85fe1183b86f6a264ef4319a 2026-05-06T08:54:00Z 2026-05-06T11:22:58Z doc: Update scc-cc.1 with ignored -pipe option Roberto E. Vargas Caballero k0ga@shike2.net commit 6da80aa96eaf48cd85fe1183b86f6a264ef4319a parent 49e32bc0eead3e6a85d284a7bbfada253e813b13 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 10:54:00 +0200 doc: Update scc-cc.1 with ignored -pipe option d6d570e027558233db7d49102557ad4865845e76 2026-05-06T08:24:01Z 2026-05-06T11:22:58Z cc2/qbe: Whitespace change Roberto E. Vargas Caballero k0ga@shike2.net commit d6d570e027558233db7d49102557ad4865845e76 parent 77bdf8dce1514fb0bb812428784f41fa02628511 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 10:24:01 +0200 cc2/qbe: Whitespace change 49e32bc0eead3e6a85d284a7bbfada253e813b13 2026-05-06T08:51:42Z 2026-05-06T11:22:58Z build/openbsd: Use scc_clang libprofile by default Roberto E. Vargas Caballero k0ga@shike2.net commit 49e32bc0eead3e6a85d284a7bbfada253e813b13 parent 77f0a2c2cff21b19223f8fae93b8344d7e57972a Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 10:51:42 +0200 build/openbsd: Use scc_clang libprofile by default Openbsd as is an old version of gas, and qbe emits some syntax that is not accepted by openbsd as. The libprofile scc_clang was added long time ago to support openbsd better, so it makes sense to use it by default. 77bdf8dce1514fb0bb812428784f41fa02628511 2026-05-06T08:22:27Z 2026-05-06T11:22:58Z cc2: Remove some of the escape sequences Roberto E. Vargas Caballero k0ga@shike2.net commit 77bdf8dce1514fb0bb812428784f41fa02628511 parent 7c50a30f3752d051e7745525d25740e88d115366 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 10:22:27 +0200 cc2: Remove some of the escape sequences Some sequences are valid C sequences, but they don't make sense when we generate the asm code, like for example the \? or others are not needed (and not accepted by assemblers) like for example \' in a string. 77f0a2c2cff21b19223f8fae93b8344d7e57972a 2026-05-06T08:25:55Z 2026-05-06T11:22:58Z Merge remote-tracking branch 'origin/master' Roberto E. Vargas Caballero k0ga@shike2.net commit 77f0a2c2cff21b19223f8fae93b8344d7e57972a parent 07765e654c10f17169bd66e0e5ca3e6205a449b7 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Wed, 6 May 2026 10:25:55 +0200 Merge remote-tracking branch 'origin/master' 7c50a30f3752d051e7745525d25740e88d115366 2026-05-02T07:47:58Z 2026-05-06T11:22:58Z Merge remote-tracking branch 'origin/master' Roberto E. Vargas Caballero k0ga@shike2.net commit 7c50a30f3752d051e7745525d25740e88d115366 parent 5c8293050bf3288cccd5249ee120460a49a43631 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Sat, 2 May 2026 09:47:58 +0200 Merge remote-tracking branch 'origin/master' 07765e654c10f17169bd66e0e5ca3e6205a449b7 2026-05-04T16:36:23Z 2026-05-06T11:22:58Z scc: Ignore -pipe option Roberto E. Vargas Caballero k0ga@shike2.net commit 07765e654c10f17169bd66e0e5ca3e6205a449b7 parent 0654230abc8c9cef6f0603ec456ef63471599e86 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Mon, 4 May 2026 18:36:23 +0200 scc: Ignore -pipe option This is used by default in OpenBSD. 0654230abc8c9cef6f0603ec456ef63471599e86 2026-05-01T20:22:23Z 2026-05-06T11:22:53Z Merge branch 'master' into dev Roberto E. Vargas Caballero k0ga@shike2.net commit 0654230abc8c9cef6f0603ec456ef63471599e86 parent 0ee5b49181c1813e136046ad648f909fe6102ea4 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 1 May 2026 22:22:23 +0200 Merge branch 'master' into dev 0ee5b49181c1813e136046ad648f909fe6102ea4 2026-05-01T17:55:24Z 2026-05-01T20:22:05Z tests/libc: Add 0095-abs Roberto E. Vargas Caballero k0ga@shike2.net commit 0ee5b49181c1813e136046ad648f909fe6102ea4 parent f9dd9d11f059550c22ff819080400574d515da8e Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 1 May 2026 19:55:24 +0200 tests/libc: Add 0095-abs f9dd9d11f059550c22ff819080400574d515da8e 2026-05-01T17:40:38Z 2026-05-01T20:22:04Z tests/libc: Add 0094-bsearch Roberto E. Vargas Caballero k0ga@shike2.net commit f9dd9d11f059550c22ff819080400574d515da8e parent d96e3eb8b442d7a67846161f37e368d5a64b95b2 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 1 May 2026 19:40:38 +0200 tests/libc: Add 0094-bsearch d96e3eb8b442d7a67846161f37e368d5a64b95b2 2026-05-01T19:47:04Z 2026-05-01T20:22:04Z libc/qsprt: Fix typo calculating nj Roberto E. Vargas Caballero k0ga@shike2.net commit d96e3eb8b442d7a67846161f37e368d5a64b95b2 parent 67dc80bf14ef15162fa94ded320c7a338a330267 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 1 May 2026 21:47:04 +0200 libc/qsprt: Fix typo calculating nj The variable nj was using nj that was not initialized and it should be ni, because nj is just the amount of space after removing the ni elements. 67dc80bf14ef15162fa94ded320c7a338a330267 2026-05-01T19:45:02Z 2026-05-01T20:22:04Z libc/qsort: Use unsigned char instead of char Roberto E. Vargas Caballero k0ga@shike2.net commit 67dc80bf14ef15162fa94ded320c7a338a330267 parent 89dd30dc93dcee2a470c322901a63dd69f476a7c Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 1 May 2026 21:45:02 +0200 libc/qsort: Use unsigned char instead of char While it is not very important in this specific case because we only transfer between char pointers, but having char can involve sign extensions that are later discarded, so it is just better to use unsigned. 89dd30dc93dcee2a470c322901a63dd69f476a7c 2026-05-01T17:03:41Z 2026-05-01T20:22:04Z tests/libc: Add 0093-system Roberto E. Vargas Caballero k0ga@shike2.net commit 89dd30dc93dcee2a470c322901a63dd69f476a7c parent 630099c016f0cb6c231f10e78b77926ae57bdfaf Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 1 May 2026 19:03:41 +0200 tests/libc: Add 0093-system 630099c016f0cb6c231f10e78b77926ae57bdfaf 2026-05-01T16:56:31Z 2026-05-01T20:22:04Z tests/libc: Add 0092-getenv Roberto E. Vargas Caballero k0ga@shike2.net commit 630099c016f0cb6c231f10e78b77926ae57bdfaf parent e11ab93848714e96d346795e2cc4be2c86dce19c Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 1 May 2026 18:56:31 +0200 tests/libc: Add 0092-getenv e11ab93848714e96d346795e2cc4be2c86dce19c 2026-05-01T11:21:02Z 2026-05-01T20:22:04Z tests/libc: Add 0091-atexit Roberto E. Vargas Caballero k0ga@shike2.net commit e11ab93848714e96d346795e2cc4be2c86dce19c parent f31dacb5f419d4e082230bd8366c97585e5c9b16 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Fri, 1 May 2026 13:21:02 +0200 tests/libc: Add 0091-atexit f31dacb5f419d4e082230bd8366c97585e5c9b16 2026-04-30T21:51:30Z 2026-05-01T20:22:04Z tests/libc: Add 0090-rand Roberto E. Vargas Caballero k0ga@shike2.net commit f31dacb5f419d4e082230bd8366c97585e5c9b16 parent 2b616739bf590b1f3cbf3740e5b60e1b56e5edd2 Author: Roberto E. Vargas Caballero <k0ga@shike2.net> Date: Thu, 30 Apr 2026 23:51:30 +0200 tests/libc: Add 0090-rand