Commit Briefs
libdraw: fix "mk"
Should default to building the library, not getsubfont.o.
libthread: run first thread in proc on system stack
For pthread systems that are fussy about which stack is used, this makes sure that threadmain runs on a system stack. If you only use proccreate (never threadcreate), all threads run on system stacks.
lib9: make a p9frexp function wrapping system frexp
Under certain conditions it looks like frexp gets #defined to something else on macOS during system headers, which then breaks the declaration in libc.h.
all: fix or silence various gcc warnings
As usual, gcc finds some real problems but also reports a ton of noise. Fix the problems and quiet the noise.
Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines. Remove blank lines from the ends of files. Change modes on source files so that they are not executable. Signed-off-by: Dan Cross <cross@gajendra.net>
src: mv ../buildEnvironmentVariables mkhdr
Also note that the file must be valid shell and mk input. For #321.
libhtml: plug a memory leak in addtext
Change-Id: I9b8a4430e7d26008ba9508095f8eb4b124a93b9b
libhtml: plug quite a few memory leaks
Change-Id: I45bd62a590373669e90183cc2b2ee56570c007f5
mk: plan9 style.
In general, no space after `if` etc, and no braces for a single statement inside of a loop or conditional. Signed-off-by: Dan Cross <cross@gajendra.net>
mk: fix out of bounds access
A loop is added for each structure field instead of accessing the other fields through the first one in one loop. Updates #313 Change-Id: I0e27e15feacb77391bc1decee7cf720d64d14586
9c: Fix case patterns for DragonFly and other BSDs
POSIX does not support grouping in case item patterns. Installing with a strict POSIX shell fails with: /usr/local/plan9/bin/9c: line 82: syntax error near unexpected token `(' /usr/local/plan9/bin/9c: line 82: `*(DragonFly|BSD)*gcc*) usegcc ;;' This change expands the patterns to work around the limitation. See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10 (and search for case_clause)
lib9, libndb: exclude terminating null from strncpy bound
GCC pointed this out with some "warning: ‘strncpy’ specified bound NUM equals destination size [-Wstringop-truncation]" warnings. Change-Id: Id8408b165f6e4ae82c96a77599d89f658d979b32
lib9: remove getcallerpc implementations
These make no sense and are not really needed at all. Add a best-effort attempt to get at the gcc/clang macro in lib9.h, but if it fails, no big deal. Fixes #324.