plan9fox/sys/src/cmd
Ori Bernstein 71939a82cc Allow address expressions in ?c after int casts.
This fixes ocaml on non-x86 architectures, where we have code
that looks like:

	#define Fl_head ((uintptr_t)(&sentinel.first_field))

Without this change, we get an error about a non-constant
initializer. This change takes the checks for pointers and
makes them apply to all expressions. It also makes the checks
stricter, preventing the following from compiling to junk:

	int x;
	int y = 42;
	int *p = &x + y
2019-09-07 18:25:04 -07:00
..
1a remove old copies of kernels l.s from cmd/?a 2014-05-08 18:48:51 +02:00
1c cc: remove nullwarn() from OCAST codegen, zap void casts 2019-06-19 23:50:33 +02:00
1l [125678kqv][cl]: fix sprint() and strcpy() buffer overflows 2015-02-17 22:13:35 +01:00
2a remove old copies of kernels l.s from cmd/?a 2014-05-08 18:48:51 +02:00
2c cc: remove nullwarn() from OCAST codegen, zap void casts 2019-06-19 23:50:33 +02:00
2l [125678kqv][cl]: fix sprint() and strcpy() buffer overflows 2015-02-17 22:13:35 +01:00
5a 5a: assemble constant >>0 right shifts as <<0 (no shift), allow >>32 2016-09-03 17:11:38 +02:00
5c cc: remove nullwarn() from OCAST codegen, zap void casts 2019-06-19 23:50:33 +02:00
5e 5e: byte access incorrectly checked for long; brk has to round up addresses 2018-09-28 22:53:24 +00:00
5i 5i ki qi vi: avoid buffer overflow in command read loop 2018-09-29 13:58:08 +02:00
5l 5l,6l,8l,kl,ql,vl: allow duplicate GLOBAL symbols (from Ori Bernstein) 2017-03-19 03:05:24 +01:00
6a 6a, 6c, 6l: fix copy propagation 2014-05-30 12:28:01 +02:00
6c 8c, 6c: LEA x, R; MOV (R), R -> MOV x, R 2019-06-24 19:38:46 +02:00
6l 8l, 6l: fix "unknown relation: TEXT" xfol() bug (thanks mischief) 2019-08-28 21:01:16 +02:00
7a 7a: fix indexreg operations 2019-04-08 13:53:41 +02:00
7c cc: remove nullwarn() from OCAST codegen, zap void casts 2019-06-19 23:50:33 +02:00
7l 7l: don't hardcode 4k pagesize, use INITRND 2019-05-17 18:14:10 +02:00
8a remove old copies of kernels l.s from cmd/?a 2014-05-08 18:48:51 +02:00
8c 8c, 6c: LEA x, R; MOV (R), R -> MOV x, R 2019-06-24 19:38:46 +02:00
8l 8l, 6l: fix "unknown relation: TEXT" xfol() bug (thanks mischief) 2019-08-28 21:01:16 +02:00
9nfs cmd: remove a bit of unused stuff 2016-11-17 02:59:40 +01:00
9660srv cmd: remove a bit of unused stuff 2016-11-17 02:59:40 +01:00
abaco abaco: fix %.*s format in findctype() 2019-02-25 04:20:43 +01:00
acid acid: provide hooks 'procattach' and 'dying' 2017-06-12 19:28:27 +00:00
acme acme: fix fd checks - initialize Window.rdselfd to -1 not 0 2018-10-20 23:57:50 +02:00
astro astro: fix typo 2014-11-26 18:56:00 -08:00
atazz atazz: fix %.*s format in special command processing 2019-02-25 04:20:00 +01:00
audio Libflac: Tell it that we have stdint.h so it finds SIZE_MAX 2019-09-07 12:37:33 -07:00
auth auth/rsa2asn1: implement private key export with -a flag (thanks kvik) 2019-08-30 07:34:35 +02:00
aux igfx: add support for 915gm 2019-03-04 21:37:52 +01:00
awk awk: no need to call getargv() twice to get the value for FILENAME 2019-05-24 17:25:44 +02:00
bitsy bitsy/keyboard: do not rely on atoi() being able to parse hex 2015-08-03 14:52:07 +02:00
bzfs make error handling in 9p service loops consistent 2016-07-24 02:21:32 +02:00
bzip2
cb cb: import updates from sources 2012-08-01 21:57:13 +02:00
cc Allow address expressions in ?c after int casts. 2019-09-07 18:25:04 -07:00
cdfs cmd: remove a bit of unused stuff 2016-11-17 02:59:40 +01:00
cec fix dangerous werrstr() usages 2014-11-07 12:51:59 +01:00
cfs cfs: close mount half of pipe, fixes cfs not exiting when unmounted 2018-09-19 13:27:55 -07:00
cifs cifs: merge with steve simons latest version. thank you very much! 2019-02-05 23:10:03 +01:00
compress
con
cpp Always turn on the -+ flag in cpp 2019-06-18 22:47:15 -07:00
cwfs cwfs: remove orphaned lrand.c 2019-06-20 14:15:20 +02:00
db db: fix unicode support (thanks giacomo) 2015-03-19 11:44:26 +01:00
dial
dict dict: similar fixes, different files. also remove runescpy 2016-03-01 21:24:35 -05:00
diff
disk disk/format: implement long name support 2019-08-19 01:09:24 +02:00
dossrv dossrv: cleanup 2018-12-24 01:21:47 +01:00
dtracy dtracy: fix && 2019-01-20 03:07:10 +00:00
eqn cmd: remove a bit of unused stuff 2016-11-17 02:59:40 +01:00
execnet fix threadsetname usage in few places 2014-05-03 13:07:52 +02:00
exportfs libc: add procsetname() 2018-09-26 14:56:23 +02:00
ext2srv
faces faces: fix callerpc for realloctag in erealloc (thanks qrstuv) 2013-09-18 09:53:20 +02:00
fax
forp forp: change indexing to verilog-like semantics 2018-12-06 10:56:32 +00:00
grap import updated compilers from sources 2012-07-30 19:11:16 +02:00
graph
grep grep: fix tab2, use int instead of Rune to be compatible to 16bit rune system 2014-03-30 18:11:51 +02:00
gs gs: apply mitigations against CVE-2017-8291 (thanks jsmoody) 2019-06-21 18:57:20 +02:00
gzip gunzip: the extra length field (XLEN) is two bytes instead of one 2015-05-15 07:53:22 +02:00
hg hg: disable tag caching, allows accessing hg repo from dump 2017-10-04 03:59:17 +02:00
hgfs hgfs: fix %.*s usage in walk 2019-02-25 04:08:13 +01:00
hjfs hjfs: set group of new files to that of the parent directory (thanks umbraticus) 2018-08-20 12:48:06 -07:00
hoc
htmlfmt htmlfmt: use uhtml for character set conversion 2014-05-12 02:38:53 +02:00
htmlroff htmlroff: fix wrong newline in \name handling (| -> ||) 2015-06-13 20:58:56 +02:00
ip ip/ipconfig: don't leave behind null address when dhcp gets interrupted 2019-09-06 18:48:35 +02:00
jpg cmd: remove a bit of unused stuff 2016-11-17 02:59:40 +01:00
ka remove old copies of kernels l.s from cmd/?a 2014-05-08 18:48:51 +02:00
kc cc: remove nullwarn() from OCAST codegen, zap void casts 2019-06-19 23:50:33 +02:00
ki 5i ki qi vi: avoid buffer overflow in command read loop 2018-09-29 13:58:08 +02:00
kl 5l,6l,8l,kl,ql,vl: allow duplicate GLOBAL symbols (from Ori Bernstein) 2017-03-19 03:05:24 +01:00
lex
lp lpdaemon: fix bogus string termination (from sources) 2013-06-14 23:22:57 +02:00
map map/libmap: remove unused function/definitions 2016-03-01 19:36:24 -05:00
mk mk: fix closing random fd from uninitialized stack variable (thanks BurnZeZ, mycroftiv) 2018-12-26 05:04:56 +01:00
mothra libpanel: fix %.*s format in pl_snarfentry() 2019-02-25 03:45:49 +01:00
ndb ndb/dnsquery, ndb/csquery: write ">" prompt to stderr (thanks kvik) 2019-08-30 20:17:19 +02:00
nusb nusb/usbd: work around devices that ignore the high byte of wLength in control transfer reads 2019-05-07 09:19:53 +02:00
paqfs make error handling in 9p service loops consistent 2016-07-24 02:21:32 +02:00
pic
plot plot: handle create() failure 2016-03-01 19:40:14 -05:00
plumb plumber: loop will go out of bounds when *++s == '\0'; replace with strstr 2019-05-31 22:15:53 +00:00
postscript postscript: use PI 2019-02-13 03:24:31 +00:00
proof cmd: remove a bit of unused stuff 2016-11-17 02:59:40 +01:00
python python: arm64 support 2019-05-03 21:11:17 +02:00
qa
qc cc: remove nullwarn() from OCAST codegen, zap void casts 2019-06-19 23:50:33 +02:00
qi 5i ki qi vi: avoid buffer overflow in command read loop 2018-09-29 13:58:08 +02:00
ql 5l,6l,8l,kl,ql,vl: allow duplicate GLOBAL symbols (from Ori Bernstein) 2017-03-19 03:05:24 +01:00
ratfs ratfs: implement ipv6 support, replace v4parsecidr() with parseipandmask() 2019-02-11 23:38:58 +01:00
rc rc: clear out redirections on "rfork F" (RFCFDG) 2019-01-20 12:02:03 +01:00
replica replica: use libavl for avl tree implementation 2017-04-22 14:28:02 -05:00
rio rio: get rid of window delete thread, fix mysterious disappearing windows 2018-12-07 16:32:04 +01:00
sam fix misleading/wrong fd checks 2018-10-20 18:44:09 +00:00
samterm fix misleading/wrong fd checks 2018-10-20 18:44:09 +00:00
scat scat: hjdicks for amd64 2016-09-19 19:04:21 +02:00
scuzz scuzz: uncomment synccache command 2015-09-22 12:23:49 +02:00
snap snap: use Mach->szaddr as the width of the stack pointer (fixes snap on amd64) 2018-11-22 20:27:27 +01:00
spell mkfiles: do not rely on path containing the . element 2013-10-26 20:22:01 +02:00
spin spin: Update to most recent version. (thanks Ori_B) 2017-11-22 21:09:31 +01:00
spred various cmds: replace magic numbers with Kdel/Keof, etc 2014-12-13 21:58:49 +01:00
syscall syscall: add missing _nsec() declaration 2014-05-20 05:21:22 +02:00
tapefs tapefs: handle more cpio formats (thanks qrstuv) 2017-03-17 00:45:48 +01:00
tbl tbl: fix wrong register count calculation (found by erik) 2013-01-05 16:59:56 +01:00
tcs remove function prototype that leaked into last commit 2018-12-26 04:51:35 +00:00
telco make error handling in 9p service loops consistent 2016-07-24 02:21:32 +02:00
troff
troff2html
upas upas/smtp: handle temporary authentication failures 2019-06-20 12:13:51 +02:00
va remove old copies of kernels l.s from cmd/?a 2014-05-08 18:48:51 +02:00
vac make error handling in 9p service loops consistent 2016-07-24 02:21:32 +02:00
vc cc: remove nullwarn() from OCAST codegen, zap void casts 2019-06-19 23:50:33 +02:00
venti venti/conf: fix padding so we write multiple of sector size 2018-01-28 17:22:00 +01:00
vi 5i ki qi vi: avoid buffer overflow in command read loop 2018-09-29 13:58:08 +02:00
vl 5l,6l,8l,kl,ql,vl: allow duplicate GLOBAL symbols (from Ori Bernstein) 2017-03-19 03:05:24 +01:00
vmx vmx: handle build arch exclude in /sys/src/cmd/mkfile 2019-05-19 17:11:57 +02:00
vnc vncv: fix snarf buffer realloc memory corruption 2019-08-26 17:02:58 +02:00
vt vt: dont make fs procs hang arround when closing rio window 2019-04-02 20:44:35 +02:00
webfs webfs: bracket literal ipv6 host in "Host:" header 2019-03-23 00:49:07 +01:00
wikifs fix dangerous werrstr() usages 2014-11-07 12:51:59 +01:00
aan.c aan: remove fcallfmt 2017-02-05 06:14:42 +01:00
alarm.c alarm: make alarm work for processes running as none 2012-03-05 18:30:46 +01:00
ar.c
archfs.c
ascii.c ascii: replace mnemonic np (new page) with ff (form feed) for consistency 2015-10-25 14:46:10 -04:00
basename.c
bc.y
bind.c
cal.c
calendar.c
camv.c camv: fix leak on resize 2018-05-20 16:47:41 +02:00
cat.c
chgrp.c chgrp: remove unused function declaration (thanks archeus) 2017-04-01 09:01:26 +00:00
chmod.c
cleanname.c
clock.c clock: remove unused variable 2016-11-17 02:12:49 +01:00
cmp.c
col.c
colors.c
comm.c
cp.c abandon streaming experiment 2016-03-17 17:48:19 +01:00
cpu.c fix misleading/wrong fd checks 2018-10-20 18:44:09 +00:00
crc32.c added crc32 2014-09-30 13:07:36 +02:00
crop.c crop: use strtol() instead of atoi() 2015-08-03 17:29:30 +02:00
date.c Add RFC2822 (email style) formatted dates to to date(1). 2019-09-06 08:25:21 -07:00
dc.c dc: fix off by one in stack overflow check (thanks BurnZeZ) 2018-07-27 09:31:28 +02:00
dd.c
deroff.c
derp.c derp: handle file type changes 2012-11-21 15:34:12 +01:00
du.c
echo.c
ecp.c
ed.c ed: dont pass string constants to mktemp() 2014-06-22 01:48:02 +02:00
factor.c
fcp.c fcp: use iounit() to determine buffer size, reduce number of worker procs to 8 2015-07-19 03:32:38 +02:00
file.c file(1): recognise unified diff output 2019-06-08 15:56:03 +09:30
fmt.c fmt: improved version using less memory 2012-10-23 02:08:35 +02:00
fortune.c fortune: avoid buffer overflow for lines >= 2K, make sure index has at least one entry, use nrand()/ntruerand() for uniform distribution 2017-03-19 22:04:26 +01:00
fplot.c fplot: fix operator associativity 2018-12-15 11:57:35 +00:00
freq.c make all the commands agnostic about Rune width. (from sources) 2013-04-24 20:13:18 +02:00
getmap.c
gview.c
histogram.c various cmds: replace magic numbers with Kdel/Keof, etc 2014-12-13 21:58:49 +01:00
history.c
html2ms.c html2ms: bold table headings, remove wrong tag space handling 2015-09-08 19:55:55 +02:00
iconv.c
idiff.c
import.c libc: add procsetname() 2018-09-26 14:56:23 +02:00
init.c init: remove dependency to <authsrv.h> 2015-08-21 23:40:31 +02:00
io.c io(1): %llx -> %ullx 2017-05-22 09:04:51 +00:00
iostats.c iostats: add -C to usage 2015-07-31 22:51:52 +02:00
join.c fix utf and rune handling in preparation for 32bit runes 2012-12-31 21:09:46 +01:00
kbmap.c various cmds: replace magic numbers with Kdel/Keof, etc 2014-12-13 21:58:49 +01:00
kprof.c kprof: fix precedence (thanks geoff) 2018-09-19 01:11:49 +02:00
ktrace.c ktrace: arm64 support 2019-05-03 21:16:23 +02:00
lens.c various cmds: replace magic numbers with Kdel/Keof, etc 2014-12-13 21:58:49 +01:00
lnfs.c make error handling in 9p service loops consistent 2016-07-24 02:21:32 +02:00
lock.c lock: reopen lockfile after changing mode to make lock effective 2015-06-13 15:01:02 +02:00
look.c
ls.c
mc.c
md5sum.c sum, md5sum, sha1sum: set exit status properly on open/read errors 2018-09-18 15:58:22 -07:00
mkdir.c
mkfile /sys/src/cmd/mkfile: fix PCONLY exclude (thanks stefan) 2019-05-24 22:52:20 +02:00
mklib mklib: add %.acid target 2018-06-08 16:48:31 +00:00
mkmany /sys/src/cmd/mk*: add $CLEANFILES to clean and nuke targets 2012-10-25 01:58:43 +02:00
mkone mkone: fix man target (thanks Amavect) 2019-05-17 01:51:28 +02:00
mksyslib acid: update acid libraries for amd64 2014-02-10 23:07:37 +01:00
mntgen.c
mount.c mount, srv: add -N flag to skip authentication and attach anonymously as "none" 2015-08-10 10:11:45 +02:00
mpc.y mpc: remove unused yylval type 2016-10-19 22:15:51 -05:00
ms2html.c ms2html: fix compiler warning 2011-12-09 22:36:40 +01:00
mtime.c
mug.c handle initdraw errors 2011-12-10 23:01:15 +01:00
mv.c
netstat.c
news.c
nfs.c
nm.c
nntpfs.c
ns.c ns: remove left over vararg check pragma 2018-02-26 19:58:54 +01:00
p.c
page.c page: remove unused variables 2016-11-17 02:11:35 +01:00
paint.c fork filter procs with RFREND in various programs 2014-02-21 05:32:20 +01:00
pbd.c
pc.y pc(1): reference counting bug 2018-12-13 10:38:21 +00:00
pcc.c pcc: back out -+ flag removal to allow gracefull upgrade path with new pcc but old cpp 2019-06-19 15:15:35 +02:00
pipefile.c
pr.c
primes.c
prof.c retire the dec alpha port 2016-05-04 16:11:48 +02:00
ps.c ps: cleanup 2012-08-02 02:53:42 +02:00
pstree.c pstree: manpage, print pid in first column, bio, silly walks 2012-11-08 00:06:54 +01:00
ptrap.c add ptrap 2018-02-05 09:38:59 +00:00
pump.c
pwd.c
qr.c add qr.c 2015-09-23 16:36:55 +02:00
ramfs.c ramfs: remove unused variable 2016-11-17 02:09:57 +01:00
ratrace.c ratrace: fix fork/exec race with "nohang" procctl (like a debugger) 2016-08-10 02:40:16 +02:00
rdbfs.c rdbfs: add -s srvname (from charles forsyth's rdbfs-srvname patch) 2013-06-14 23:28:59 +02:00
read.c read: add -c flag to copy bytes instead of lines 2012-07-02 17:46:21 +02:00
resample.c resample: simplify getint() 2015-08-03 18:30:02 +02:00
resize.c resize: add -n for nearest neighbour 2015-09-23 17:52:35 +02:00
rm.c
rotate.c more generic way to deal with image chan conversion for resize/resample/rotate 2012-10-18 20:17:12 +02:00
rx.c rx: remove ssh code 2017-01-13 19:54:42 +01:00
sat.c add sat(1) command 2018-03-18 03:03:12 +00:00
scram.c scram: remove _PTS(5). it just doesn't make any sense 2016-10-15 23:42:22 +02:00
screenlock.c screenlock: put position check back in grabmouse (thanks deuteron) 2017-12-03 16:34:35 +01:00
seconds.c add seconds(1) command 2012-05-22 05:16:23 +02:00
sed.c sed: only dollars as first address are a problem for -u 2018-11-05 20:17:48 +00:00
seg.c io, seg: we should exits(nil) at the end of main 2013-05-28 20:06:53 -04:00
seq.c
sh.C
sha1sum.c sum, md5sum, sha1sum: set exit status properly on open/read errors 2018-09-18 15:58:22 -07:00
size.c
sleep.c
sort.c fix sort(1) bug where it incorrectly included the field separator in the comparison if it was >= Runeself 2018-02-07 18:53:08 +00:00
split.c fix misleading/wrong fd checks 2018-10-20 18:44:09 +00:00
srv.c mount, srv: add -N flag to skip authentication and attach anonymously as "none" 2015-08-10 10:11:45 +02:00
srvfs.c
ssh.c ssh: work around github.com's broken cipher negotiation code (thanks Ori_B) 2019-05-27 02:11:16 +02:00
sshfs.c sshfs: add exits(nil) to threadmain 2018-12-10 05:18:05 +00:00
sshnet.c sshnet: get rid of Announced state, simplify 2019-04-03 23:49:22 +02:00
stats.c stats: fix etherstats, avoid vmax == 0 2018-09-09 00:24:43 +02:00
strings.c we look for strings.c, it is broken, this strings.c will make us go. 2014-05-30 04:05:18 +02:00
strip.c
sum.c sum, md5sum, sha1sum: set exit status properly on open/read errors 2018-09-18 15:58:22 -07:00
swap.c
tail.c tail: fix follow for empty files (thanks cinap_lenrek) 2014-05-08 14:29:44 +02:00
tar.c tar: remove unused variable 2016-11-17 02:14:59 +01:00
tee.c tee: get rid of openf[100] array and just dup() filedescriptors to 3+[0..n-1] 2014-12-21 05:12:56 +01:00
test.c test: use libc.h constants for access() mode (thanks qrstuv) 2015-05-31 09:37:59 +02:00
time.c
timepic.c timepic: string support 2015-09-29 20:49:28 +02:00
tlsclient.c tlsclient: allow dumping the server's certificate with new -d flag 2018-01-06 07:43:08 +01:00
tlssrv.c tlssrv: remove usage reference to lost auth/secretpem 2018-01-06 08:44:12 +01:00
touch.c
touchfs.c
tprof.c
tput.c tput: check sbrk return value 2015-08-25 03:06:36 -07:00
tr.c tr: fix 4-byte runes fix (thanks rsc) 2014-04-26 14:26:40 +02:00
trace.c cpu, ratrace, trace: remove unused #include <bio.h> 2013-09-08 20:34:58 +02:00
truetypefs.c truetypefs: fall back to width if advance is zero 2018-10-12 08:34:17 -07:00
ttfrender.c add ttfrender(1) 2018-06-09 14:34:44 +00:00
tweak.c fix utf and rune handling in preparation for 32bit runes 2012-12-31 21:09:46 +01:00
uhtml.c uhtml: dont trust charset=utf-8 attribute, verify. 2016-03-13 23:47:24 +01:00
unicode.c unicode: use Runeerror 2012-12-31 22:49:29 +01:00
uniq.c uniq: use Bsize for buffers 2014-05-03 10:48:13 +02:00
units.y correcting unicode superscripts for 1 2 and 3 2012-02-23 16:58:53 +01:00
unlnfs.c
unmount.c
urlencode.c urlencode: fix /fd/0 use 2012-10-13 15:35:39 +02:00
walk.c walk: remove unused depth argument from dofile() 2019-03-30 15:10:36 +00:00
wc.c wc: flags dont need to be uvlong 2015-02-15 06:26:49 +01:00
webcookies.c webcookies: strdup() file argument to avoid crash (thanks mischief) 2015-11-30 20:08:22 +01:00
winwatch.c winwatch: show windows with empty labels (thanks jpm) 2017-09-11 19:17:12 +02:00
xargs.c
xd.c xd: use new bio magic to make -u more efficient 2017-06-12 19:56:57 +00:00
yacc.c fix yacc bug (found by dan cross) 2017-04-21 17:16:44 +00:00