duskos

dusk os fork
git clone git://git.alexwennerberg.com/duskos
Log | Files | Refs | README | LICENSE

commit 73c0e0061e53f763a227217ec2479f2c076a8cfe
parent 1ee79239a2cbdf75021dbcf56155dea46b3df196
Author: Virgil Dupras <hsoft@hardcoded.net>
Date:   Tue,  6 Sep 2022 14:44:32 -0400

cc: fix incorrect test

"++x--" is invalid C because the result of "x--", which has precedence over
"++", is not a lvalue.

Diffstat:
Mfs/tests/cc/cc.fs | 2+-
Mfs/tests/cc/test.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/tests/cc/cc.fs b/fs/tests/cc/cc.fs @@ -24,7 +24,7 @@ ptrset 54 #eq 12 condif 13 #eq 42 condif 142 #eq 42 incdec 43 #eq -54 incdecp 55 #eq +54 incdecp 54 #eq exprparens 9 #eq cnoop ( no result! ) scnt 0 #eq 42 ptrari 46 #eq diff --git a/fs/tests/cc/test.c b/fs/tests/cc/test.c @@ -90,7 +90,7 @@ extern int incdec(int x) { extern int incdecp(int x) { x++; x--; - return ++x--; + return x--; } // test that parens override precedence extern int exprparens() {