fork of 9front i guess
Find a file
cinap_lenrek 3426459ab5 cc: fix spurious warning on comparsion with scope redeclared variable (thanks aiju)
> warning: a.c:9 useless or misleading comparison: UINT < 0

the error can be observed by compiling the following code
with warnings enabled:

#include <u.h>
#include <libc.h>

uint r;

void
main(int argc, char *argv[])
{
	int r;

	if(r < 0){
		exits(0);
	}
}

the offending code in the compiler is:

-	if(l->op == ONAME && l->sym->type){
-		lt = l->sym->type;
-		if(lt->etype == TARRAY)
-			lt = lt->link;
-	}

compiler handles scope by overwritin and reverting
symbols while parsing. in the ccom phase, the nodes symbol
(n->sym) is not in the right scope and we wrongly think r
is uint instead of int.

it is not clear to me what this code tried to accomplish in
the first place nor could anyone answer me this question.

the risk is small as this change doesnt affect the compiled
program, only the warning, so removing the offending code.
2014-05-06 21:36:28 +02:00
386
68000
68020
acme
adm/timezone
alpha
amd64 libc and ape support for amd64 2014-02-01 10:31:41 +01:00
arm
lib fonts: add swastika to naga10. fixes swastika in default font 2014-05-04 22:14:45 +02:00
mips
power
power64
rc newt: write message header and body to virtual file before printing, to avoid stutter 2014-04-25 09:25:08 -04:00
sparc
sparc64
sys cc: fix spurious warning on comparsion with scope redeclared variable (thanks aiju) 2014-05-06 21:36:28 +02:00
.hgignore