plan9fox/sys
cinap_lenrek 485a3301e6 cc: fix wrong "useless or misleading comparison" warning
to reproduce:

 	u8int x, y;

 	x = 0xff;
 	y = 0xc0;
 	if((s8int)(x & y) >= 0)
 		print("help\n");

compiles correctly but prints a warning

warning: test.c:11 useless or misleading comparison: UINT >= 0

the issue is that compar() unconditionally skipped over
all left casts ignoring the case when a cast would sign
extend the value.

the new code only skips over the cast when the original
type with is smaller than the cast result or when they
are equal width and types have same signedness. so the
effective left hand side type is the last truncation
or sign extension.
2018-11-18 20:42:45 +01:00
..
doc /sys/doc: fix mkfile to and remove files that now can be regenerated 2017-05-09 16:23:48 +02:00
games/lib fortunes: I'm beginning to wonder if anyone is left that isn't part of 9front? -- Steve Stallion 2018-10-04 23:23:50 -04:00
include add dtracy.h 2018-11-10 20:01:19 +00:00
lib /sys/lib/dist/mkfile: add pi.img target for raspi sdcard image 2018-10-22 00:16:04 +02:00
man ip/dhcpd: Add swap server support in dhcpd (thanks k0ga) 2018-11-08 21:15:07 +01:00
src cc: fix wrong "useless or misleading comparison" warning 2018-11-18 20:42:45 +01:00