scc, branch HEADsimple c99 compiler
9b162b0052316caaec77869017c395d0d050033e2026-03-05T14:31:26Z2026-03-05T14:31:26Zcc1: Accept integer comparations in enum variablesRoberto E. Vargas Caballerok0ga@shike2.netcommit 9b162b0052316caaec77869017c395d0d050033e
parent 05c02ab56769cd7ff85630d501627941d6abe84f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 5 Mar 2026 15:31:26 +0100
cc1: Accept integer comparations in enum variables
05c02ab56769cd7ff85630d501627941d6abe84f2026-02-20T14:04:53Z2026-02-20T14:04:53Ztests: Update READMERoberto E. Vargas Caballerok0ga@shike2.netcommit 05c02ab56769cd7ff85630d501627941d6abe84f
parent 494b5e954619ec4212db5a08c3f3b355b8104785
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 20 Feb 2026 15:04:53 +0100
tests: Update README
494b5e954619ec4212db5a08c3f3b355b81047852026-02-20T08:32:02Z2026-02-20T08:36:24Zcc1: Fix va_start() warningRoberto E. Vargas Caballerok0ga@shike2.netcommit 494b5e954619ec4212db5a08c3f3b355b8104785
parent 9ef71d0377a399f0e0c8e3bcfd47843fb5d66210
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 20 Feb 2026 09:32:02 +0100
cc1: Fix va_start() warning
The va_start() builtin was checking if the parameter actually received was the actual
last named parameter of a function with variable argument list, but it tried to get
the ellipsis type from the list of arguments itself, but the list of arguments only
has the named arguments, so it was not possible to match the ellipsis type. In order
to check that it is required to go to the list of argument types of the function type.
9ef71d0377a399f0e0c8e3bcfd47843fb5d662102026-02-20T08:23:49Z2026-02-20T08:23:49Zcc1: Mark builltin with side effectRoberto E. Vargas Caballerok0ga@shike2.netcommit 9ef71d0377a399f0e0c8e3bcfd47843fb5d66210
parent 99a2aaeb775c3ba5d69e48b2501af71fce63e648
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 20 Feb 2026 09:23:49 +0100
cc1: Mark builltin with side effect
The vaarg builtins are used to handle variable length argument and
they do modify the va argument that they receive, so emiting warnings
for them didn't make sense.
99a2aaeb775c3ba5d69e48b2501af71fce63e6482026-02-18T20:01:47Z2026-02-18T20:06:47Zbuild: Use LIBPREFIX for crt files in muslRoberto E. Vargas Caballerok0ga@shike2.netcommit 99a2aaeb775c3ba5d69e48b2501af71fce63e648
parent 28c274e634e5bb1a8a99ee403f1373b6db7fcd07
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 18 Feb 2026 21:01:47 +0100
build: Use LIBPREFIX for crt files in musl
In the case of musl there is a total disconnection between the prefix used by
scc and the prefix used when building and installing musl. In order to make
easier the configuration of musl this commits just insert the prefix obtained
by the output of gcc.
28c274e634e5bb1a8a99ee403f1373b6db7fcd072026-02-18T18:45:06Z2026-02-18T18:45:06Zcc1: Warn only in different macro redefinitionsRoberto E. Vargas Caballerok0ga@shike2.netcommit 28c274e634e5bb1a8a99ee403f1373b6db7fcd07
parent 40275b12f4b192d63d7d6702fd3caaa8eb3f5bc5
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 18 Feb 2026 19:45:06 +0100
cc1: Warn only in different macro redefinitions
The standard says that redefining a macro with a different value is undefined
behaviour. Scc uses to warn in any redefinition of macros, but as there are
some projects that like to redefine them continously this generated too much
noise, and this commit moved the warning to only when the defintion is different.
40275b12f4b192d63d7d6702fd3caaa8eb3f5bc52026-02-18T09:18:32Z2026-02-18T09:18:32Zdoc: Update scc man page to scc-ccRoberto E. Vargas Caballerok0ga@shike2.netcommit 40275b12f4b192d63d7d6702fd3caaa8eb3f5bc5
parent 7c107f7208d33678855fb5ff8197d2a085cc4617
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 18 Feb 2026 10:18:32 +0100
doc: Update scc man page to scc-cc
Scc is the wrapper tool now, and the name of the compiler binary is scc-cc.
7c107f7208d33678855fb5ff8197d2a085cc46172026-02-18T09:16:48Z2026-02-18T09:18:21Zdriver/posix: Improve command line compatibilityRoberto E. Vargas Caballerok0ga@shike2.netcommit 7c107f7208d33678855fb5ff8197d2a085cc4617
parent 42b50c811c8ad0f6db4fca6088bc67f33cce224e
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 18 Feb 2026 10:16:48 +0100
driver/posix: Improve command line compatibility
Sadly, the world is out of any hope, and accepting to ignore flags used
by some mainstream compilers help a lot.
42b50c811c8ad0f6db4fca6088bc67f33cce224e2026-02-16T15:53:25Z2026-02-16T15:56:26Zbuild: Use better config-musl targetRoberto E. Vargas Caballerok0ga@shike2.netcommit 42b50c811c8ad0f6db4fca6088bc67f33cce224e
parent 5042ac1a04b0b0e797f20fb56d9e377870d513c7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 16 Feb 2026 16:53:25 +0100
build: Use better config-musl target
The config-musl target was a helper to make easier to configure scc
with a musl external libc, but it failed in native musl distributions
like for example alpine. This new target is expected to be more robust
and work in native and non native distributions.
5042ac1a04b0b0e797f20fb56d9e377870d513c72026-02-16T15:46:00Z2026-02-16T15:46:00Zcc1: Add unary - folding for floatsRoberto E. Vargas Caballerok0ga@shike2.netcommit 5042ac1a04b0b0e797f20fb56d9e377870d513c7
parent 8b3404606cd8120322ef7816442a7fb938e7b513
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 16 Feb 2026 16:46:00 +0100
cc1: Add unary - folding for floats
This is required for static initializers.
8b3404606cd8120322ef7816442a7fb938e7b5132026-02-16T10:24:54Z2026-02-16T10:24:54Zcc1: Mark cpp else blocksRoberto E. Vargas Caballerok0ga@shike2.netcommit 8b3404606cd8120322ef7816442a7fb938e7b513
parent dd2b510053f9b9bfd2eb4f249d493b5f42c3c489
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 16 Feb 2026 11:24:54 +0100
cc1: Mark cpp else blocks
Once we find a #else then no more #else or #elif can happen
in the current preprocessor conditional context and we have
to mark it to be able to detect this condition.
dd2b510053f9b9bfd2eb4f249d493b5f42c3c4892026-02-16T10:07:29Z2026-02-16T10:07:29Ztests/cc: Use diff -uRoberto E. Vargas Caballerok0ga@shike2.netcommit dd2b510053f9b9bfd2eb4f249d493b5f42c3c489
parent 3300cf3d3e2a83b6b6c438fd40b8a9a6b164900e
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 16 Feb 2026 11:07:29 +0100
tests/cc: Use diff -u
Diff -u generates diff files easier to understand.
3300cf3d3e2a83b6b6c438fd40b8a9a6b164900e2026-02-16T09:21:16Z2026-02-16T09:21:16Zlibc: Improve gcc-sscRoberto E. Vargas Caballerok0ga@shike2.netcommit 3300cf3d3e2a83b6b6c438fd40b8a9a6b164900e
parent d1f3dc2a94c8cb46bb67259642a1059983de36be
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 16 Feb 2026 10:21:16 +0100
libc: Improve gcc-ssc
The crt file should be the first object in the list, because it pulls the main
symbol and maybe other required symbols. For many platforms it is not a big
issue because the crt only uses the main symbol, but in some other cases it
may pull other symbols. Also, forcing -g didn't make too much sense, and it
was not difficult to handle it correctly.
d1f3dc2a94c8cb46bb67259642a1059983de36be2026-02-16T09:09:47Z2026-02-16T09:13:27Zdoc: Update LICENSE fileRoberto E. Vargas Caballerok0ga@shike2.netcommit d1f3dc2a94c8cb46bb67259642a1059983de36be
parent 8b8b25fa24223ca929a77253d26c76b3c596ffd6
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 16 Feb 2026 10:09:47 +0100
doc: Update LICENSE file
8b8b25fa24223ca929a77253d26c76b3c596ffd62026-02-15T20:42:44Z2026-02-16T09:13:09Zgcc-scc.sh: parse options using getoptsAvi Halachmi (:avih)avihpit@yahoo.comcommit 8b8b25fa24223ca929a77253d26c76b3c596ffd6
parent c31a24c04de5785a76725ea7e2fea652e192b107
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Sun, 15 Feb 2026 22:42:44 +0200
gcc-scc.sh: parse options using getopts
Previously, the options parsing code rejected some valid inputs,
such as -ofile (in one arg).
Now we use standarg getopts which conforms to the POSIX syntax
guidelines.
Additionally, improve the error message on unknown option:
- print to stderr instead of stdout.
- quote it (otherwise these are globs...).
- Add spaces between the options (still less than 70 chars).
c31a24c04de5785a76725ea7e2fea652e192b1072026-02-15T20:22:19Z2026-02-16T08:45:58Zscc-cpp.sh and gcc-scc.sh: improve handling of argumentsAvi Halachmi (:avih)avihpit@yahoo.comcommit c31a24c04de5785a76725ea7e2fea652e192b107
parent 534a9fa01a8a0c080df60800a370421dc594532c
Author: Avi Halachmi (:avih) <avihpit@yahoo.com>
Date: Sun, 15 Feb 2026 22:22:19 +0200
scc-cpp.sh and gcc-scc.sh: improve handling of arguments
Previously, any argument to scc-cpp.sh and some arguments to gcc-scc.sh
were broken if they contained any IFS chars, such as space.
Now correct quoting is used in these scripts, which do maintain the
arguments correctly.
In scc-cpp.sh the change is trivial from $@ to "$@" .
In gcc-scc.sh it's a bit more involved as arguments are handled
individually and iteratively.
The big change is replacing .c with .o for all file names for $ld,
where instead of converting the whole line in one sed, we now iterate
the files individually while maintaining any IFS chars in them
534a9fa01a8a0c080df60800a370421dc594532c2026-02-15T10:12:28Z2026-02-15T10:16:56Zmake: Escape values passed in MAKEFLAGSRoberto E. Vargas Caballerok0ga@shike2.netcommit 534a9fa01a8a0c080df60800a370421dc594532c
parent d94c6547755e253374bb6da489b5c01f69680dbc
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 15 Feb 2026 11:12:28 +0100
make: Escape values passed in MAKEFLAGS
The POSIX standard says:
The macro= value macro definition operands can also be
included. The difference between the contents of MAKEFLAGS
and the make utility command line is that the contents of the
variable shall not be subjected to the word expansions (see Word
Expansions) associated with parsing the command line values.
And it basically means that we have to escape the parameters passed
in MAKEFLAGS and then unescape and doing the word spliting. The code
had a naive strtok() implementation for word spliting, and it had to
be replaced for a more complex parsing function which also handles
escapes and quotes with ' and ".
d94c6547755e253374bb6da489b5c01f69680dbc2026-02-15T10:07:41Z2026-02-15T10:07:41Zposix: Quote parameters passed down in sccRoberto E. Vargas Caballerok0ga@shike2.netcommit d94c6547755e253374bb6da489b5c01f69680dbc
parent ffc56872a365f518ba8899157a2738a5462df500
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 15 Feb 2026 11:07:41 +0100
posix: Quote parameters passed down in scc
The scc wrapper has to preserve the parameters in the best
possible way to avoid spliting words in the wrong places
when they are passed down to the specific tools.
ffc56872a365f518ba8899157a2738a5462df5002026-02-12T11:46:45Z2026-02-12T11:46:45Zcc2: Add missed dependencies for riscvRoberto E. Vargas Caballerok0ga@shike2.netcommit ffc56872a365f518ba8899157a2738a5462df500
parent 0dc121edaac1b54277f2eac7c3fac45746326ff2
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 12 Feb 2026 12:46:45 +0100
cc2: Add missed dependencies for riscv
0dc121edaac1b54277f2eac7c3fac45746326ff22026-02-11T13:44:44Z2026-02-11T13:44:44Ztests/make: Fix mistakes after trap changesRoberto E. Vargas Caballerok0ga@shike2.netcommit 0dc121edaac1b54277f2eac7c3fac45746326ff2
parent 5eedaa9f030481f63ab828c89c0623068fd2b7a7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 11 Feb 2026 14:44:44 +0100
tests/make: Fix mistakes after trap changes
5eedaa9f030481f63ab828c89c0623068fd2b7a72026-02-11T13:38:41Z2026-02-11T13:38:41Zmake: Change default CFLAGS and FFLAGSRoberto E. Vargas Caballerok0ga@shike2.netcommit 5eedaa9f030481f63ab828c89c0623068fd2b7a7
parent 3ef4da68f555260111abb67615a28885bf57a7b5
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 11 Feb 2026 14:38:41 +0100
make: Change default CFLAGS and FFLAGS
This is a very weird situation, because classical cc accepted -O to
enable optimizations, but POSIX 2004 specified -O level for c99, but it
specified -O for default value of CFLAGS in make. This conjuction made
that gcc accepts -O1 but not -O 1, because -O 1 is interpreted like
the -O option and the source file 1. That makes that the default CFLAGS
of POSIX make cannot work with gcc (and clang), but GNU make uses -O1
instead of the -O 1 specified in POSIX. Seems both values should be
accepted by compliant POSIX tools, in order to avoid problems the best
option is to follow GNU make here and use -O1 instead of -O 1, even
when it is not strictly POSIX compliant.
3ef4da68f555260111abb67615a28885bf57a7b52026-02-10T13:38:36Z2026-02-11T08:23:19Zcc2: Generalize keeplabel()Roberto E. Vargas Caballerok0ga@shike2.netcommit 3ef4da68f555260111abb67615a28885bf57a7b5
parent 61adffcdcf6e9aeb0c762fb0ba3974d6c2e648c4
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 10 Feb 2026 14:38:36 +0100
cc2: Generalize keeplabel()
Having a keeplabel() call in every case where we can modify the
statement with the current label is very fragile, and we should to
search for a more general solution where we don't have to care
anymore about this problem. We could modify the parser to get rid
of labels in statements and have only label statements, but it is
much more simple to check for that case in every call to sethi().
61adffcdcf6e9aeb0c762fb0ba3974d6c2e648c42026-02-10T10:26:43Z2026-02-10T12:06:30Zcc2: Keep label position in branchesRoberto E. Vargas Caballerok0ga@shike2.netcommit 61adffcdcf6e9aeb0c762fb0ba3974d6c2e648c4
parent 91d6c4c2e9cf507de205fab129a65be40fb1c6b3
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 10 Feb 2026 11:26:43 +0100
cc2: Keep label position in branches
When a branch is transformed into a set of jumps new statements are
inserted before the current statement, displacing the relative position
of the label of the current statement in case of having one. For that
reason in this case we have to create a label statment and place there
the label.
91d6c4c2e9cf507de205fab129a65be40fb1c6b32026-02-10T10:26:43Z2026-02-10T11:33:06Zcc2: Keep label position in commasRoberto E. Vargas Caballerok0ga@shike2.netcommit 91d6c4c2e9cf507de205fab129a65be40fb1c6b3
parent 9e85b6a1ad15b70aefd3436ca605aea2f523f335
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 10 Feb 2026 11:26:43 +0100
cc2: Keep label position in commas
When a comma is transformed into a set of jumps new statements are
inserted before the current statement, displacing the relative position
of the label of the current statement in case of having one. For that
reason in this case we have to create a label statment and place there
the label.
9e85b6a1ad15b70aefd3436ca605aea2f523f3352026-02-10T10:26:43Z2026-02-10T11:33:06Zcc2: Keep label position in logic expressionsRoberto E. Vargas Caballerok0ga@shike2.netcommit 9e85b6a1ad15b70aefd3436ca605aea2f523f335
parent 8be6d9e4cd588fd6110a4252e36848214ad04b28
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 10 Feb 2026 11:26:43 +0100
cc2: Keep label position in logic expressions
When a logic is transformed into a set of jumps new statements are
inserted before the current statement, displacing the relative position
of the label of the current statement in case of having one. For that
reason in this case we have to create a label statment and place there
the label.
8be6d9e4cd588fd6110a4252e36848214ad04b282026-02-10T10:26:43Z2026-02-10T11:33:06Zcc2: Keep label position in ternariesRoberto E. Vargas Caballerok0ga@shike2.netcommit 8be6d9e4cd588fd6110a4252e36848214ad04b28
parent f3c4d6c3e0822ccf373935eb8851660bbd298931
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 10 Feb 2026 11:26:43 +0100
cc2: Keep label position in ternaries
When a ternary is transformed into a set of jumps new statements are
inserted before the current statement, displacing the relative position
of the label of the current statement in case of having one. For that
reason in this case we have to create a label statment and place there
the label.
f3c4d6c3e0822ccf373935eb8851660bbd2989312026-02-10T10:00:03Z2026-02-10T11:33:01Zcc2: Preserve labels in replace()Roberto E. Vargas Caballerok0ga@shike2.netcommit f3c4d6c3e0822ccf373935eb8851660bbd298931
parent 46588de4ca1b0a4c47591d61c5947dc1a3238ce5
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 10 Feb 2026 11:00:03 +0100
cc2: Preserve labels in replace()
The intention of replace is replacing a node with other, but in
case the original node had a label it was lost in the replace
process.
46588de4ca1b0a4c47591d61c5947dc1a3238ce52026-02-09T15:08:49Z2026-02-09T15:11:07Zcc1: Add support for non constant auto initializersRoberto E. Vargas Caballerok0ga@shike2.netcommit 46588de4ca1b0a4c47591d61c5947dc1a3238ce5
parent 34b628de0fe4f297e8e5ef969a6355748a8154ef
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 9 Feb 2026 16:08:49 +0100
cc1: Add support for non constant auto initializers
This has been an important miss in scc for a while. While this code is not
guranteed to work for all the cases, and it can generate really bad code,
it works for the most common casesa and it can be used to bootstrap them.
34b628de0fe4f297e8e5ef969a6355748a8154ef2026-02-04T11:41:41Z2026-02-09T12:42:30Zcc1: Disable string emit in initializersRoberto E. Vargas Caballerok0ga@shike2.netcommit 34b628de0fe4f297e8e5ef969a6355748a8154ef
parent c74e72c72af0f7ce01fe1388f4d542a57c5ed70f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 4 Feb 2026 12:41:41 +0100
cc1: Disable string emit in initializers
When we are dealing with initializers there are transformations done
to the original strings to fit with the target type, like adding additional
0 or removing characters if it is bigger. That meant that we were emitting
strings that were not actually used, because the initializers were emitting
their own copy of these strings. In case of having an error in initialize()
the disstring variable would remain set, but that is not a problem because
in that state we don't emit anything else.
Also, the function str2ary() had a bug hidden in how the new string
was generated, but due to other bug that string was not used ever.
The new code avoids using str* alike functions because it would break
when the array has embedded NUL characters.
c74e72c72af0f7ce01fe1388f4d542a57c5ed70f2026-02-02T11:43:35Z2026-02-02T11:46:46Ztests/cc: Add 0239-fcasts.cRoberto E. Vargas Caballerok0ga@shike2.netcommit c74e72c72af0f7ce01fe1388f4d542a57c5ed70f
parent cdd599b1db41f2983c446c0fdefb799afbb511eb
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 2 Feb 2026 12:43:35 +0100
tests/cc: Add 0239-fcasts.c
cdd599b1db41f2983c446c0fdefb799afbb511eb2026-02-02T11:37:24Z2026-02-02T11:37:24Zcc1: Fix padding in initializersRoberto E. Vargas Caballerok0ga@shike2.netcommit cdd599b1db41f2983c446c0fdefb799afbb511eb
parent 42441dfa818cce4c67092948f8113fd1afef41ab
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 2 Feb 2026 12:37:24 +0100
cc1: Fix padding in initializers
The alignment calculation was wrong and it generated static struct and arrays
with data misplaced.
42441dfa818cce4c67092948f8113fd1afef41ab2026-01-31T19:36:23Z2026-01-31T19:36:23Zobjdump: Minor typo in error stringRoberto E. Vargas Caballerok0ga@shike2.netcommit 42441dfa818cce4c67092948f8113fd1afef41ab
parent 8287e1aeccdcf88a7ac6d415ca162ccb474da3af
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 31 Jan 2026 20:36:23 +0100
objdump: Minor typo in error string
8287e1aeccdcf88a7ac6d415ca162ccb474da3af2026-01-31T18:53:02Z2026-01-31T18:53:02Zcc2/qbe: Fix floating point conversionsRoberto E. Vargas Caballerok0ga@shike2.netcommit 8287e1aeccdcf88a7ac6d415ca162ccb474da3af
parent 0f0d3edeb1988957d0196482eec84366956cb574
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 31 Jan 2026 19:53:02 +0100
cc2/qbe: Fix floating point conversions
The operations were inverted and it tried to truncate when it had to
extend, and it tried to extend when it had to truncate.
0f0d3edeb1988957d0196482eec84366956cb5742026-01-31T18:05:39Z2026-01-31T18:05:39Zcc1: Fold constant casts involving floatsRoberto E. Vargas Caballerok0ga@shike2.netcommit 0f0d3edeb1988957d0196482eec84366956cb574
parent 3b5e9eb7079be6f946a66c2b751921723680a5aa
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 31 Jan 2026 19:05:39 +0100
cc1: Fold constant casts involving floats
3b5e9eb7079be6f946a66c2b751921723680a5aa2026-01-31T08:50:03Z2026-01-31T08:55:12Zcc2/qbe: Fix bug introduced in b83ec8edRoberto E. Vargas Caballerok0ga@shike2.netcommit 3b5e9eb7079be6f946a66c2b751921723680a5aa
parent eaf2b18533e87462e71e588fd6edd96d937622b2
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 31 Jan 2026 09:50:03 +0100
cc2/qbe: Fix bug introduced in b83ec8ed
The commit b83ec8ed modified the code of binary operations because in
the case of comparisions we have a cmp node with float type, but the
result is integer. The intermediate language used cannot express cases
like this one, because it assumes that the operand and the result have
the same type. The commit b83ec8ed assumes that the piece of code
modified applied only to comparisions, but in fact, it affected to
any binary operation, producing that all the binary operations were
casted to int32type.
eaf2b18533e87462e71e588fd6edd96d937622b22026-01-30T20:50:42Z2026-01-30T20:50:42Zcc1: Fix definition of __FLT_EVAL_METHOD__Roberto E. Vargas Caballerok0ga@shike2.netcommit eaf2b18533e87462e71e588fd6edd96d937622b2
parent b83ec8ed7ab5e20a968b8e1a00236036ea363131
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 30 Jan 2026 21:50:42 +0100
cc1: Fix definition of __FLT_EVAL_METHOD__
b83ec8ed7ab5e20a968b8e1a00236036ea3631312026-01-30T20:37:48Z2026-01-30T20:37:48Zcc1: Use type punning to pass floats to cc2Roberto E. Vargas Caballerok0ga@shike2.netcommit b83ec8ed7ab5e20a968b8e1a00236036ea363131
parent f41102032108467135842e9f36c4dfd1072c4d62
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 30 Jan 2026 21:37:48 +0100
cc1: Use type punning to pass floats to cc2
Doesn't mind what we do that we cannot pass a floating point
number from cc1 to cc2 in a fully portable way, and using
type punning at least maintain the endianess correctly. This
code should even work in cross compilation as far as the host
and the target use the same floating point representation,
that today will likely be the ieee 754.
f41102032108467135842e9f36c4dfd1072c4d622026-01-30T16:06:37Z2026-01-30T16:06:37Zcc1: Fix pointer cast typeRoberto E. Vargas Caballerok0ga@shike2.netcommit f41102032108467135842e9f36c4dfd1072c4d62
parent 475fa03250d04142fb1aeb9635ffe7e3eac434c8
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 30 Jan 2026 17:06:37 +0100
cc1: Fix pointer cast type
475fa03250d04142fb1aeb9635ffe7e3eac434c82026-01-30T14:44:17Z2026-01-30T14:49:50Zcc1: Add support for float constantRoberto E. Vargas Caballerok0ga@shike2.netcommit 475fa03250d04142fb1aeb9635ffe7e3eac434c8
parent c3b8a3ef1ef7df8ae85b1d0b9061725a02c356dc
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 30 Jan 2026 15:44:17 +0100
cc1: Add support for float constant
Strtold already manages all the complexity of dealing with floating
point numbers.
c3b8a3ef1ef7df8ae85b1d0b9061725a02c356dc2026-01-30T11:49:24Z2026-01-30T14:49:50Zcc1: Add support for c99 float arithmeticRoberto E. Vargas Caballerok0ga@shike2.netcommit c3b8a3ef1ef7df8ae85b1d0b9061725a02c356dc
parent b057d1fdf510c655916a99184421b0197c5da056
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 30 Jan 2026 12:49:24 +0100
cc1: Add support for c99 float arithmetic
C99 allows arithmetic operations to be performed in floats, while K&R and C90
promoted floats to double. This was the behaviour of scc until now, but this
commit enables operations in float and also add folding of long double constants.
b057d1fdf510c655916a99184421b0197c5da0562026-01-30T09:42:53Z2026-01-30T09:42:53Zcc1: Be careful about float optimizationsRoberto E. Vargas Caballerok0ga@shike2.netcommit b057d1fdf510c655916a99184421b0197c5da056
parent b8ad553523ba96ddf4c363befb1a5397b18af440
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 30 Jan 2026 10:42:53 +0100
cc1: Be careful about float optimizations
As described in 5.1.2.3p14:
Rearrangement for floating-point expressions is often restricted
because of limitations in precision as well as range. The
implementation cannot generally apply the mathematical associative
rules for addition or multiplication, nor the distributive rule,
because of roundoff error, even in the absence of overflow and
underflow. Likewise, implementations cannot generally replace
decimal constants in order to rearrange expressions. In the
following fragment, rearrangements suggested by mathematical
rules for real numbers are often not valid.
b8ad553523ba96ddf4c363befb1a5397b18af4402026-01-29T19:53:34Z2026-01-29T19:53:34Zcc1: Fold correctly unary in sizeofRoberto E. Vargas Caballerok0ga@shike2.netcommit b8ad553523ba96ddf4c363befb1a5397b18af440
parent 7dbb2d53125f9592cf579c0e948c56eb886a8a3c
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 29 Jan 2026 20:53:34 +0100
cc1: Fold correctly unary in sizeof
When a parenthesis happens after a sizeof it can mean a type name or
an unary expression. The code was correctly detecting the type name
case, but in the unary case it assumed that the unary expresion was
equal to ( expr ) but unary can be also ( expr ) postfix, failling
in cases like:
sizeof(array)[0]
7dbb2d53125f9592cf579c0e948c56eb886a8a3c2026-01-29T19:22:24Z2026-01-29T19:22:24Zcc1: Use int for namespacesRoberto E. Vargas Caballerok0ga@shike2.netcommit 7dbb2d53125f9592cf579c0e948c56eb886a8a3c
parent 8e07fdb59f3eaca0e5e8ad160f4d2ae37270360e
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 29 Jan 2026 20:22:24 +0100
cc1: Use int for namespaces
The code in decl.c was protecting against overflow using INT_MAX,
but the Symbols and types were using unsigned char or char, that
made mismatching when the lookup was performed.
8e07fdb59f3eaca0e5e8ad160f4d2ae37270360e2026-01-29T14:48:18Z2026-01-29T14:48:18Zcc1: Parse correctly **/ commentsRoberto E. Vargas Caballerok0ga@shike2.netcommit 8e07fdb59f3eaca0e5e8ad160f4d2ae37270360e
parent 661b5b01217b553c0e0b142ae41bdf9c9b2ac14b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 29 Jan 2026 15:48:18 +0100
cc1: Parse correctly **/ comments
The parser was consuming always a character when a * was found, making
that even number of * followed by a / were not considered an end of
comment.
661b5b01217b553c0e0b142ae41bdf9c9b2ac14b2026-01-29T12:35:25Z2026-01-29T12:35:25Zcc1: Accept digits in macro parametersRoberto E. Vargas Caballerok0ga@shike2.netcommit 661b5b01217b553c0e0b142ae41bdf9c9b2ac14b
parent b04e1786f2fbbf3976b6d0aba4cc122aefd23bc7
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 29 Jan 2026 13:35:25 +0100
cc1: Accept digits in macro parameters
The last changes about parsing macro definitions creates a new bug because they
defined identifiers only using alpha and _ characters, but it should accept
digits after the 1st character.
b04e1786f2fbbf3976b6d0aba4cc122aefd23bc72026-01-29T11:36:50Z2026-01-29T11:36:50Zcc1: Fix elif handlingRoberto E. Vargas Caballerok0ga@shike2.netcommit b04e1786f2fbbf3976b6d0aba4cc122aefd23bc7
parent 740fd29faa97cc8a39c7e48c368191bc2df9cc99
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 29 Jan 2026 12:36:50 +0100
cc1: Fix elif handling
The code was assuming that an #else was always inverting the state of the
preprocessor output, and elif was handled like a #else plus a #if, but
that was not the actual case. The code tried to manage this situation
counting the number of nested enabling/disabling of cppoff, but it was
a non sense because we already had a stack of cpp contexts that could do
the work much better. Also, we needed a sticky variable (called "done"
in this commit) to track that one case of the if-else chain was true
before, because the "enabled" field changes and then we forget the history
of the chain.
740fd29faa97cc8a39c7e48c368191bc2df9cc992026-01-29T11:25:29Z2026-01-29T11:25:29Zcc1: Simplify getdefs()Roberto E. Vargas Caballerok0ga@shike2.netcommit 740fd29faa97cc8a39c7e48c368191bc2df9cc99
parent 58a4f1584eb24dd4204d8b4d87b06a11acede509
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 29 Jan 2026 12:25:29 +0100
cc1: Simplify getdefs()
We can unify the IDEN and string cases if we use yytext/yylen in the
case of IDEN because the STRING case is handled by the tokenizer to
avoid code duplication.
58a4f1584eb24dd4204d8b4d87b06a11acede5092026-01-28T14:12:29Z2026-01-28T14:12:29Zcc1: Remove macro tokens from the tokenizerRoberto E. Vargas Caballerok0ga@shike2.netcommit 58a4f1584eb24dd4204d8b4d87b06a11acede509
parent dcde10bc7be69fa1c7e497f67754f5323649f5cf
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 28 Jan 2026 15:12:29 +0100
cc1: Remove macro tokens from the tokenizer
The macro definitions are currently handled by the preprocessor
itself which means that the tokenizer should not see these tokens
anymore in a valid sequence, and it means that we can remove it.
dcde10bc7be69fa1c7e497f67754f5323649f5cf2026-01-28T13:58:35Z2026-01-28T13:58:35Zcc1: Rewrite macro defintion parserRoberto E. Vargas Caballerok0ga@shike2.netcommit dcde10bc7be69fa1c7e497f67754f5323649f5cf
parent fad9e0fb2e77d701992ea2e740f8c3bb67e9a049
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 28 Jan 2026 14:58:35 +0100
cc1: Rewrite macro defintion parser
The macro definition parser was based in the tokenizer used by
cc1 but it means that the input string was modified adding
spaces around the tokens, which in normal use cases does not
generate any problems. Some people does things like:
#define STDIO <stdio.h>
#include STDIO
that is not conformant becuase the preprocessor is allowed to
work based in C tokens that would split the previous macro in:
< stdio . h >
This commits modifies the parser of macro definitions to not
using the tokenizer (except in the case of strings) and preserve
the input string as much as possible.
fad9e0fb2e77d701992ea2e740f8c3bb67e9a0492026-01-27T12:12:06Z2026-01-27T12:12:06Zlibc: Add missed bits/wchar.h to the proto fileRoberto E. Vargas Caballerok0ga@shike2.netcommit fad9e0fb2e77d701992ea2e740f8c3bb67e9a049
parent fbf964d8de9d5dc603d674e67f9c1236373827e6
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 27 Jan 2026 13:12:06 +0100
libc: Add missed bits/wchar.h to the proto file
fbf964d8de9d5dc603d674e67f9c1236373827e62026-01-27T11:11:06Z2026-01-27T11:11:06Zlibc: Protect redefinitions of __va_list and __wcharRoberto E. Vargas Caballerok0ga@shike2.netcommit fbf964d8de9d5dc603d674e67f9c1236373827e6
parent b392aeafa794ca5b5aecdf93475c3869af3a9747
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 27 Jan 2026 12:11:06 +0100
libc: Protect redefinitions of __va_list and __wchar
b392aeafa794ca5b5aecdf93475c3869af3a97472026-01-27T08:55:06Z2026-01-27T08:59:41Zcc1: Remove NR_MAXSTRUCTSRoberto E. Vargas Caballerok0ga@shike2.netcommit b392aeafa794ca5b5aecdf93475c3869af3a9747
parent 0b09e68a1bc71be5eaa5754c98365cf677992aed
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 27 Jan 2026 09:55:06 +0100
cc1: Remove NR_MAXSTRUCTS
This limit is not defined by any standard, and it was creating an
artificial limit that does not help at all to discover non portable
programs because it checked for something useless.
0b09e68a1bc71be5eaa5754c98365cf677992aed2026-01-24T10:51:44Z2026-01-24T10:51:44ZMerge remote-tracking branch 'origin'Roberto E. Vargas Caballerok0ga@shike2.netcommit 0b09e68a1bc71be5eaa5754c98365cf677992aed
parent dc99102efafb82f90ae3f39ce98f30e06f94335b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 24 Jan 2026 11:51:44 +0100
Merge remote-tracking branch 'origin'
dc99102efafb82f90ae3f39ce98f30e06f94335b2026-01-24T10:50:19Z2026-01-24T10:50:19Ztests: Avoid using mktempRoberto E. Vargas Caballerok0ga@shike2.netcommit dc99102efafb82f90ae3f39ce98f30e06f94335b
parent 68568d529414af1522832b6fe63bf163306e0c8f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 24 Jan 2026 11:50:19 +0100
tests: Avoid using mktemp
Mktemp is not posix and it is usually not needed for our use case.
68568d529414af1522832b6fe63bf163306e0c8f2026-01-24T10:47:43Z2026-01-24T10:47:43Zbuild: Use exit $? in signal trapsRoberto E. Vargas Caballerok0ga@shike2.netcommit 68568d529414af1522832b6fe63bf163306e0c8f
parent a4f6e0ebf74b40d95b8d4de20bd0eb890efefaf3
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 24 Jan 2026 11:47:43 +0100
build: Use exit $? in signal traps
This helps to preserve the exit status instead of just using 1
for all the signals.
8e32d090646d3eddcd4206c11920afc3a2c891372026-01-16T12:15:44Z2026-01-16T15:22:20Zcc1: Fix comment typosZhaoming Luozhml@posteo.comcommit 8e32d090646d3eddcd4206c11920afc3a2c89137
parent cd97844f7cd875616f4b97c675b08ce41aee9df3
Author: Zhaoming Luo <zhml@posteo.com>
Date: Fri, 16 Jan 2026 12:15:44 +0000
cc1: Fix comment typos
cd97844f7cd875616f4b97c675b08ce41aee9df32026-01-16T12:15:42Z2026-01-16T15:22:00Zdoc: Fix typo in READMEZhaoming Luozhml@posteo.comcommit cd97844f7cd875616f4b97c675b08ce41aee9df3
parent 52cf2e9986d52e8e812a30b94dc118dabb1aea1f
Author: Zhaoming Luo <zhml@posteo.com>
Date: Fri, 16 Jan 2026 12:15:42 +0000
doc: Fix typo in README
a4f6e0ebf74b40d95b8d4de20bd0eb890efefaf32026-01-06T00:14:33Z2026-01-06T00:14:33Zbuild: Preserve exit status scripts/configRoberto E. Vargas Caballerok0ga@shike2.netcommit a4f6e0ebf74b40d95b8d4de20bd0eb890efefaf3
parent 52cf2e9986d52e8e812a30b94dc118dabb1aea1f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 6 Jan 2026 01:14:33 +0100
build: Preserve exit status scripts/config
52cf2e9986d52e8e812a30b94dc118dabb1aea1f2026-01-05T21:22:18Z2026-01-05T21:22:18Zlibmach: Add findseg()Roberto E. Vargas Caballerok0ga@shike2.netcommit 52cf2e9986d52e8e812a30b94dc118dabb1aea1f
parent ece7fade7d459523af266428e95b4f587a2f0ba9
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 5 Jan 2026 22:22:18 +0100
libmach: Add findseg()
This function returns the segment index in the map. This function is
mainly designed to be used in elf where there is a difference between
sections and segments.
ece7fade7d459523af266428e95b4f587a2f0ba92026-01-05T20:33:03Z2026-01-05T20:52:49Ztests/libc: Add 0067-wcwidthRoberto E. Vargas Caballerok0ga@shike2.netcommit ece7fade7d459523af266428e95b4f587a2f0ba9
parent 361a63ace0c9cec71586b8c6f79397a981c32589
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 5 Jan 2026 21:33:03 +0100
tests/libc: Add 0067-wcwidth
361a63ace0c9cec71586b8c6f79397a981c325892026-01-05T20:19:16Z2026-01-05T20:51:16Zobjdump: Fix format string in dumpscns()Roberto E. Vargas Caballerok0ga@shike2.netcommit 361a63ace0c9cec71586b8c6f79397a981c32589
parent 0f88acf52504636f56b73132285c7355b1beb0af
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 5 Jan 2026 21:19:16 +0100
objdump: Fix format string in dumpscns()
0f88acf52504636f56b73132285c7355b1beb0af2026-01-05T19:24:01Z2026-01-05T20:51:16Zlibc: Include a mbstate_t in FILERoberto E. Vargas Caballerok0ga@shike2.netcommit 0f88acf52504636f56b73132285c7355b1beb0af
parent 84128eaf37e33fed023f271018b157b7398ad91c
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Mon, 5 Jan 2026 20:24:01 +0100
libc: Include a mbstate_t in FILE
Several of the file operations related to wchar require
a mbstate_t, and every stream should have its own mbstate_t
and not using the hidden state of several of the conversion
functions.
84128eaf37e33fed023f271018b157b7398ad91c2026-01-04T20:18:49Z2026-01-04T20:18:49Zlibc/stdlib: Minor improvements to realloc()Roberto E. Vargas Caballerok0ga@shike2.netcommit 84128eaf37e33fed023f271018b157b7398ad91c
parent ae0058502d81d2742783b1d1800784319341ff12
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 21:18:49 +0100
libc/stdlib: Minor improvements to realloc()
ae0058502d81d2742783b1d1800784319341ff122026-01-04T20:14:43Z2026-01-04T20:14:43Zlibc/wchar: Whitespace changeRoberto E. Vargas Caballerok0ga@shike2.netcommit ae0058502d81d2742783b1d1800784319341ff12
parent 117e2caee5ca7b1441e2e4c4135c2aaac7b5cc78
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 21:14:43 +0100
libc/wchar: Whitespace change
117e2caee5ca7b1441e2e4c4135c2aaac7b5cc782026-01-04T20:09:03Z2026-01-04T20:09:03Ztests: Minor improvementsRoberto E. Vargas Caballerok0ga@shike2.netcommit 117e2caee5ca7b1441e2e4c4135c2aaac7b5cc78
parent 0f61a6528784b5add0eef1d64ea16eb5adf689f9
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 21:09:03 +0100
tests: Minor improvements
0f61a6528784b5add0eef1d64ea16eb5adf689f92026-01-04T19:48:34Z2026-01-04T20:06:08Zlibc/string: Minor improvementsRoberto E. Vargas Caballerok0ga@shike2.netcommit 0f61a6528784b5add0eef1d64ea16eb5adf689f9
parent 9a60d2a80efcd85c85f90b1c0406c8fe3f324f5b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 20:48:34 +0100
libc/string: Minor improvements
9a60d2a80efcd85c85f90b1c0406c8fe3f324f5b2026-01-04T19:29:39Z2026-01-04T20:06:08Zlibc/wchar: Add wctob()Roberto E. Vargas Caballerok0ga@shike2.netcommit 9a60d2a80efcd85c85f90b1c0406c8fe3f324f5b
parent c4b7399c26bf3040f33b4760e162495d74d85d73
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 20:29:39 +0100
libc/wchar: Add wctob()
c4b7399c26bf3040f33b4760e162495d74d85d732026-01-04T19:17:51Z2026-01-04T19:22:52Zlibc/wchar: Add btowc()Roberto E. Vargas Caballerok0ga@shike2.netcommit c4b7399c26bf3040f33b4760e162495d74d85d73
parent 534e0b91e27ad3cb37404d696cd1c0044a8ebe18
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 20:17:51 +0100
libc/wchar: Add btowc()
534e0b91e27ad3cb37404d696cd1c0044a8ebe182026-01-04T18:47:25Z2026-01-04T18:47:25Ztests/libc: Add 0043-wcsrtombsRoberto E. Vargas Caballerok0ga@shike2.netcommit 534e0b91e27ad3cb37404d696cd1c0044a8ebe18
parent 005f4c376c05bd22e21761cf063ea76fb9338dc1
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sun, 4 Jan 2026 19:47:25 +0100
tests/libc: Add 0043-wcsrtombs
005f4c376c05bd22e21761cf063ea76fb9338dc12026-01-03T17:55:53Z2026-01-03T17:55:53Zlibc: Add wcstokRoberto E. Vargas Caballerok0ga@shike2.netcommit 005f4c376c05bd22e21761cf063ea76fb9338dc1
parent b2eb6e5269977992d88d388ff30a078aa9101a42
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 3 Jan 2026 18:55:53 +0100
libc: Add wcstok
b2eb6e5269977992d88d388ff30a078aa9101a422026-01-03T17:37:44Z2026-01-03T17:37:44Zlibc: Reorder common-objs.mkRoberto E. Vargas Caballerok0ga@shike2.netcommit b2eb6e5269977992d88d388ff30a078aa9101a42
parent 836ed99e5aa87033470b3594597070cb0e00148b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 3 Jan 2026 18:37:44 +0100
libc: Reorder common-objs.mk
836ed99e5aa87033470b3594597070cb0e00148b2026-01-03T16:47:00Z2026-01-03T16:47:00ZMerge remote-tracking branch 'origin/master'Roberto E. Vargas Caballerok0ga@shike2.netcommit 836ed99e5aa87033470b3594597070cb0e00148b
parent 452190b652a22d2d5ba1fbc2106bf7847944f582
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 3 Jan 2026 17:47:00 +0100
Merge remote-tracking branch 'origin/master'
47361f9afa1e1b5b31f58052d3253e1067dcd7732026-01-03T14:35:47Z2026-01-03T14:35:47Zbuild: Build bootstrap make in scriptsRoberto E. Vargas Caballerok0ga@shike2.netcommit 47361f9afa1e1b5b31f58052d3253e1067dcd773
parent 5b69547863e7e3da563e26164c34f22585920377
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 3 Jan 2026 15:35:47 +0100
build: Build bootstrap make in scripts
Just to keep the top level directory cleaner.
5b69547863e7e3da563e26164c34f225859203772026-01-03T14:24:55Z2026-01-03T14:24:55Ztests: Use $TEST in every scc invocationRoberto E. Vargas Caballerok0ga@shike2.netcommit 5b69547863e7e3da563e26164c34f22585920377
parent 6d67d778d8a2bfe2093233d1fae81663f712aa2a
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 3 Jan 2026 15:24:55 +0100
tests: Use $TEST in every scc invocation
using a variable before executing any of the commands allows to use
emulators of checkers easilly just setting that variable.
6d67d778d8a2bfe2093233d1fae81663f712aa2a2026-01-03T13:14:58Z2026-01-03T14:23:30Zbuild: Fix use of trapRoberto E. Vargas Caballerok0ga@shike2.netcommit 6d67d778d8a2bfe2093233d1fae81663f712aa2a
parent c825c03e6f3b1e3a757a47c75d77ce57ebb1624d
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 3 Jan 2026 14:14:58 +0100
build: Fix use of trap
Using the same trap for EXIT and signals has the problem that
signals don't finish the current execution. For that reason
is better to use different traps and do the cleaning only in
the EXIT trap while the signals just use exits that eventually
will call the EXIT trap.
452190b652a22d2d5ba1fbc2106bf7847944f5822025-11-18T15:47:52Z2025-11-18T18:14:23Zinclude: Remove parameter names in prototypesRoberto E. Vargas Caballerok0ga@shike2.netcommit 452190b652a22d2d5ba1fbc2106bf7847944f582
parent 87e4396fb51faf4eac6fbd0a853e8c9d93c88fa2
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 18 Nov 2025 16:47:52 +0100
include: Remove parameter names in prototypes
Just be consistent and apply the same style in all the files.
87e4396fb51faf4eac6fbd0a853e8c9d93c88fa22025-11-18T14:26:53Z2025-11-18T18:14:23Zinclude: Remove extern in function declarationsRoberto E. Vargas Caballerok0ga@shike2.netcommit 87e4396fb51faf4eac6fbd0a853e8c9d93c88fa2
parent ad5bd51963863fe5a3c3ad58a1ae42d578aa8980
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 18 Nov 2025 15:26:53 +0100
include: Remove extern in function declarations
This was introduced some time ago to follow some style
but it does not help so much, and it only makes longer
the declaration of the functions.
ad5bd51963863fe5a3c3ad58a1ae42d578aa89802025-11-18T13:01:45Z2025-11-18T18:12:31Zinclude: Remove T* typesRoberto E. Vargas Caballerok0ga@shike2.netcommit ad5bd51963863fe5a3c3ad58a1ae42d578aa8980
parent c825c03e6f3b1e3a757a47c75d77ce57ebb1624d
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 18 Nov 2025 14:01:45 +0100
include: Remove T* types
These types didn't work very well, and at some point we stopped
using them. Removing them makes the code more straigh forward
and avoids some stupid casts in printf alike function calls.
c825c03e6f3b1e3a757a47c75d77ce57ebb1624d2025-11-18T10:46:36Z2025-11-18T11:07:16Zdoc: Remove outdated bugRoberto E. Vargas Caballerok0ga@shike2.netcommit c825c03e6f3b1e3a757a47c75d77ce57ebb1624d
parent 3d92a3b0d83de06ce99f320906711d2d21f9a0c4
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 18 Nov 2025 11:46:36 +0100
doc: Remove outdated bug
3d92a3b0d83de06ce99f320906711d2d21f9a0c42025-10-31T17:19:56Z2025-10-31T17:19:56Ztests/ar: Fix file name in 0039-update.shRoberto E. Vargas Caballerok0ga@shike2.netcommit 3d92a3b0d83de06ce99f320906711d2d21f9a0c4
parent 1ed0ff0000999561feee336c289252faf2502a7e
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 31 Oct 2025 18:19:56 +0100
tests/ar: Fix file name in 0039-update.sh
1ed0ff0000999561feee336c289252faf2502a7e2025-10-29T09:57:06Z2025-10-29T09:57:06Ztests: Set error codeRoberto E. Vargas Caballerok0ga@shike2.netcommit 1ed0ff0000999561feee336c289252faf2502a7e
parent 00bae5c394c9b1d31586ffa1ee2f77a3edcc6f0a
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 29 Oct 2025 10:57:06 +0100
tests: Set error code
Having a correct error code when make tests is executed helps to detect
when a test failed.
00bae5c394c9b1d31586ffa1ee2f77a3edcc6f0a2025-10-28T20:21:11Z2025-10-28T20:21:11Ztests/make: Reduce the timeout for 0102-signalRoberto E. Vargas Caballerok0ga@shike2.netcommit 00bae5c394c9b1d31586ffa1ee2f77a3edcc6f0a
parent 65e5c373ca2fa947a604a1e0ea35843c8c104658
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 28 Oct 2025 21:21:11 +0100
tests/make: Reduce the timeout for 0102-signal
This timeout never had to be changed, because changing it
was only hiding the actual problem, which was a race condition
due to the incorrect signal handling.
65e5c373ca2fa947a604a1e0ea35843c8c1046582025-10-28T20:12:08Z2025-10-28T20:12:08Zmake: Use a local signal variableRoberto E. Vargas Caballerok0ga@shike2.netcommit 65e5c373ca2fa947a604a1e0ea35843c8c104658
parent 93e07bb34a825734d760971f811ac43868fd8c48
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 28 Oct 2025 21:12:08 +0100
make: Use a local signal variable
As the global stop variable is used in cleanup() we can be
caught by one signal when we enter in cleanup but stop can
be pointing to a different signal at the end of that function.
93e07bb34a825734d760971f811ac43868fd8c482025-10-28T20:10:31Z2025-10-28T20:10:31Zscc-make: Avoid signal race conditionsRoberto E. Vargas Caballerok0ga@shike2.netcommit 93e07bb34a825734d760971f811ac43868fd8c48
parent e19109cd35b8d64480c74389b8faaedf5af9b0ed
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 28 Oct 2025 21:10:31 +0100
scc-make: Avoid signal race conditions
Expecting ait to be interrupted by a signal is too risky
and it is very easy to be caught by race conditions. The
best option is to kill in the snal handler and lock signals
until we are ready to deal with them.
e19109cd35b8d64480c74389b8faaedf5af9b0ed2025-10-17T07:40:03Z2025-10-17T07:40:03Ztests/make: Increment timeout for 0102-signalRoberto E. Vargas Caballerok0ga@shike2.netcommit e19109cd35b8d64480c74389b8faaedf5af9b0ed
parent 6d9a517cf4c6b5133030b9744531340d22cef719
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 17 Oct 2025 09:40:03 +0200
tests/make: Increment timeout for 0102-signal
This tests shows to be a bit flaky. Increment the time
can help a bit.
6d9a517cf4c6b5133030b9744531340d22cef7192025-10-16T11:22:18Z2025-10-17T07:39:55Zbuild: Modify include pathRoberto E. Vargas Caballerok0ga@shike2.netcommit 6d9a517cf4c6b5133030b9744531340d22cef719
parent 6c3c992dc8f759f8c4052a4fb0d47d7681282664
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Thu, 16 Oct 2025 13:22:18 +0200
build: Modify include path
6c3c992dc8f759f8c4052a4fb0d47d76812826642025-08-05T12:00:25Z2025-08-05T12:00:25ZMerge remote-tracking branch 'origin/master'Roberto E. Vargas Caballerok0ga@shike2.netcommit 6c3c992dc8f759f8c4052a4fb0d47d7681282664
parent 23c081533234d616d3cc57e5794ee1b9f2a87b63
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 5 Aug 2025 14:00:25 +0200
Merge remote-tracking branch 'origin/master'
23c081533234d616d3cc57e5794ee1b9f2a87b632025-08-05T11:53:18Z2025-08-05T11:53:18Zmake: Make cleanup voidRoberto E. Vargas Caballerok0ga@shike2.netcommit 23c081533234d616d3cc57e5794ee1b9f2a87b63
parent 7d92f9f22004c00fca2fe52a183b8d8e1a1bca6f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 5 Aug 2025 13:53:18 +0200
make: Make cleanup void
It does not return any value ever, so it does not make sense to
have it like int, and it created problems porting it to plan9.
2a2e57ae043b6d78a5dbd50761971d65085407292025-06-17T18:16:23Z2025-06-17T19:05:29Zlibc/malloc: Unify malloc and reallocRoberto E. Vargas Caballerok0ga@shike2.netcommit 2a2e57ae043b6d78a5dbd50761971d6508540729
parent 2b33af36beceaf67507ab881f113d68a371a4f13
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 17 Jun 2025 20:16:23 +0200
libc/malloc: Unify malloc and realloc
realloc(p, 0) should behave like malloc(0), but we were not setting the
same errno values, and we were returning NULL in both cases, that makes
more difficult to differentiate the case when 0 is passed and the case
when we don't have enough memory. Given that the traditional behaviour
was always to return a pointer that could be freed (and even that was
the original behaviour in scc) this commit restores that behaviour.
2b33af36beceaf67507ab881f113d68a371a4f132025-06-17T19:04:13Z2025-06-17T19:05:29Ztests/make: Unset MAKEFLAGSRoberto E. Vargas Caballerok0ga@shike2.netcommit 2b33af36beceaf67507ab881f113d68a371a4f13
parent ac449d18a971e3e452e3f47cbd2af90b6a55ea18
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 17 Jun 2025 21:04:13 +0200
tests/make: Unset MAKEFLAGS
Some make implementations set MAKEFLAGS to non portable values
creating some problems when running the tests when we move from
the driven make to the make under test.
ac449d18a971e3e452e3f47cbd2af90b6a55ea182025-06-13T20:31:14Z2025-06-17T16:41:17Zscc-make: parseargv(): properly handle the -- argument, add test.Z. Gilboawriteonce@midipix.orgcommit ac449d18a971e3e452e3f47cbd2af90b6a55ea18
parent 30255fb57a7b5abf021e417aa34f380ae92bdbbe
Author: Z. Gilboa <writeonce@midipix.org>
Date: Fri, 13 Jun 2025 20:31:14 +0000
scc-make: parseargv(): properly handle the -- argument, add test.
30255fb57a7b5abf021e417aa34f380ae92bdbbe2025-06-14T07:42:49Z2025-06-17T07:48:14Z.gitignore: add missing entry for /src/cmd/scc-dump.Z. Gilboawriteonce@midipix.orgcommit 30255fb57a7b5abf021e417aa34f380ae92bdbbe
parent 63c66208e583d8538351428cb2d5bdf0aabe3e26
Author: Z. Gilboa <writeonce@midipix.org>
Date: Sat, 14 Jun 2025 07:42:49 +0000
.gitignore: add missing entry for /src/cmd/scc-dump.
63c66208e583d8538351428cb2d5bdf0aabe3e262025-06-04T14:36:22Z2025-06-04T14:36:22Zdriver/posix: Enable QBE for any arch/abiRoberto E. Vargas Caballerok0ga@shike2.netcommit 63c66208e583d8538351428cb2d5bdf0aabe3e26
parent 1f8f494a8504aa99052554476d86bcd0d6a7a1ba
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 4 Jun 2025 16:36:22 +0200
driver/posix: Enable QBE for any arch/abi
The validation for the correct combination of QBE, arch and abi
is done when the qbe target selection is done, so we don't have
to care about it when we select the scc backend used to generate
the QBE IL.
1f8f494a8504aa99052554476d86bcd0d6a7a1ba2025-06-04T14:31:49Z2025-06-04T14:31:49Zdriver/posix: Adjust qbe command line based in the targetRoberto E. Vargas Caballerok0ga@shike2.netcommit 1f8f494a8504aa99052554476d86bcd0d6a7a1ba
parent d853268357f02d13ca7377e2391b8ebb6290daad
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 4 Jun 2025 16:31:49 +0200
driver/posix: Adjust qbe command line based in the target
Qbe supports multiple ABIs and they are selected using the
command line flag -t.
d853268357f02d13ca7377e2391b8ebb6290daad2025-06-04T14:08:26Z2025-06-04T14:08:26Zcc2: Add support for qbe riscv64Roberto E. Vargas Caballerok0ga@shike2.netcommit d853268357f02d13ca7377e2391b8ebb6290daad
parent faf643c9afc0a74b276f24a8fdb4ba8552e351b3
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 4 Jun 2025 16:08:26 +0200
cc2: Add support for qbe riscv64
faf643c9afc0a74b276f24a8fdb4ba8552e351b32025-06-04T14:08:07Z2025-06-04T14:08:07Zcc2/arm64: Removed unused peep.cRoberto E. Vargas Caballerok0ga@shike2.netcommit faf643c9afc0a74b276f24a8fdb4ba8552e351b3
parent 06266207ce41e9fa1b7c2232b0a0243481287fd6
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 4 Jun 2025 16:08:07 +0200
cc2/arm64: Removed unused peep.c
This file was only a placeholder for the times when we built a
skeleton for arm64 without using qbe. As we don't build that
skeleton anymore, it does not make sense to keep this placeholder
anymore in the repository.
06266207ce41e9fa1b7c2232b0a0243481287fd62025-06-04T14:06:01Z2025-06-04T14:06:01Zcc1: Add support for riscv64Roberto E. Vargas Caballerok0ga@shike2.netcommit 06266207ce41e9fa1b7c2232b0a0243481287fd6
parent 7d92f9f22004c00fca2fe52a183b8d8e1a1bca6f
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 4 Jun 2025 16:06:01 +0200
cc1: Add support for riscv64
7d92f9f22004c00fca2fe52a183b8d8e1a1bca6f2025-05-27T18:19:30Z2025-05-27T18:19:30Zbuild: Remove redundant make buildRoberto E. Vargas Caballerok0ga@shike2.netcommit 7d92f9f22004c00fca2fe52a183b8d8e1a1bca6f
parent 6182ec6e314de95182742064f5bb2d80abf11c8c
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 27 May 2025 20:19:30 +0200
build: Remove redundant make build
Scc-make was already built before this rule began its execution.
6182ec6e314de95182742064f5bb2d80abf11c8c2025-05-24T04:54:25Z2025-05-24T04:57:54Zlibc/vfprintf: Adjust variable typesRoberto E. Vargas Caballerok0ga@shike2.netcommit 6182ec6e314de95182742064f5bb2d80abf11c8c
parent 9c55c9b38fb53863c83f8d59ea6241682b2ea463
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Sat, 24 May 2025 06:54:25 +0200
libc/vfprintf: Adjust variable types
9c55c9b38fb53863c83f8d59ea6241682b2ea4632025-05-13T08:14:24Z2025-05-13T08:14:24Zdoc: Clarify how to use muslRoberto E. Vargas Caballerok0ga@shike2.netcommit 9c55c9b38fb53863c83f8d59ea6241682b2ea463
parent 5900420c8566844b1e379dc62adb0467142f56d6
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Tue, 13 May 2025 10:14:24 +0200
doc: Clarify how to use musl