Commit Graph

1384 Commits

Author SHA1 Message Date
mrg
de11d87641 introduce some common variables for use in GCC warning disables:
GCC_NO_FORMAT_TRUNCATION    -Wno-format-truncation (GCC 7/8)
GCC_NO_STRINGOP_TRUNCATION  -Wno-stringop-truncation (GCC 8)
GCC_NO_STRINGOP_OVERFLOW    -Wno-stringop-overflow (GCC 8)
GCC_NO_CAST_FUNCTION_TYPE   -Wno-cast-function-type (GCC 8)

use these to turn off warnings for most GCC-8 complaints.  many
of these are false positives, most of the real bugs are already
commited, or are yet to come.


we plan to introduce versions of (some?) of these that use the
"-Wno-error=" form, which still displays the warnings but does
not make it an error, and all of the above will be re-considered
as either being "fix me" (warning still displayed) or "warning
is wrong."
2019-10-13 07:28:04 +00:00
mrg
cfe79b5b48 use memcpy() for strings that are not C strings.
destinations are already sufficiently sized and nul terminated.
2019-10-05 23:35:57 +00:00
mrg
21303c93e9 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-29 23:44:58 +00:00
sjg
7d130808c7 Do not assume safe to pass NULL to realpath(3).
PR: 54574
Reviewed by: buhrow
2019-09-26 21:09:55 +00:00
sjg
bda55a25a3 ParseDoDependency: free paths rather than assert
PR: 52737
Reviewed by: christos
2019-04-09 18:28:10 +00:00
gutteridge
1c2ba908cc make(1): minor grammar fixes in BUGS section 2019-02-16 07:41:12 +00:00
mrg
a0193bc54d - use -Wno-error=format-truncation 2019-02-04 03:58:41 +00:00
mrg
fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
sjg
38267d9f3b ParseVErrorInternal: use .PARSEDIR and
apply realpath(3) if not absolute,
and use .PARSEFILE for consitent results.

Reviewed by: christos
2018-12-22 00:36:32 +00:00
sjg
dca4343b05 unexport-env: avoid SEGFAULT if MAKELEVEL not in env 2018-12-21 05:50:19 +00:00
christos
25ae7c06e6 PR/53796: Valery Ushakov: make prints wrong makefile path in an error message
Use ${.CURDIR} if ${.PARSEDIR} is not absolute.
2018-12-17 02:06:00 +00:00
christos
3b6f899d34 use %s formats to avoid -flag confusion (from sjg) 2018-12-16 18:53:34 +00:00
christos
3aa82d61be Use printf instead of echo since we can't portably use \ in string (from sjg@)
http://pubs.opengroup.org/onlinepubs/009695399/utilities/echo.html
2018-12-16 17:30:57 +00:00
christos
3a280067df Fix previous: cached_stats() returning < 0 means that the file is not found,
not that it was found in the cache, and centralize reporting.
2018-07-12 18:03:31 +00:00
reinoud
38c2b03323 Remove duplicate code in make(1)'s dir.c.
When the cached_stats() code was added, some old logic stayed around that
implements the cached_stats() too.
2018-07-12 17:46:37 +00:00
christos
2357fc5dd5 use SUBDIR.roff suggested by uwe@ 2018-06-10 17:55:11 +00:00
christos
c50a4e606c - Introduce :q modifier for make variables and make it double escape $'s so
that passing variables to recursive makes with :q works as expected.
- Revert :Q to work as before.
- Adjust makefiles that use recursive make to use :q

Discussed on tech-toolchain@
XXX: pullup 8
2018-05-27 01:14:50 +00:00
christos
fe59327913 Since ${MAKE} converts $$ -> $ during parsing we need to put it back to
preserve the original variable value with :Q.
XXX: pullup-8
2018-05-24 00:27:24 +00:00
christos
45d3ba4e45 unit test for $ underquoting in :Q modifier 2018-05-24 00:25:44 +00:00
sjg
7ccc79ce72 Just skip polling job token pipe.
The sigchld pipe ensures no busy wait.

PR: 53285
Reviewed by:
2018-05-13 22:13:28 +00:00
christos
e7f0fa0971 PR/53285: Andreas Gustafsson: Build times tripled with make/job.c 1.193
Revert previous:
    2018.05.12.15.14.49/bracket.db:build_wall_time=4896.09
    2018.05.12.18.17.04/bracket.db:build_wall_time=16268.98
2018-05-13 12:10:36 +00:00
sjg
68df7c9526 Skip setting wantToken.
polling the job token pipe adds a lot of overhead
for little gain.
For now, just leave wantToken=0

And avoid busy waiting when no tokens are available and
no jobs are running.

Reviewed by: christos
2018-05-12 18:17:04 +00:00
christos
7a9e78e3c6 Appease the compiler gods; yes I know what I am doing adding to a literal
string.
2018-04-05 16:31:54 +00:00
christos
331fc54718 Be more selective about detecting a SYSV include as opposed to a dependency
line. Dependency lines should contain a '::' operator or ':<space>'.
2018-04-05 00:31:10 +00:00
dholland
377ca2b42e Fix bad markup. 2018-04-02 04:26:17 +00:00
sjg
b4dd1ca28c Avoid calling sysconf for every file loaded.
At start of a meta build this can be measurable overhead.

Patch from bdrewery at freebsd.org
2018-02-22 01:59:28 +00:00
sjg
13b51c6c09 Var_Set: avoid SIGSEGV if val is NULL
A NULL val is handled gracefully (by VarAdd) when
var is not previously set, so we ought not crash
the second time.

PR: 53034
2018-02-18 00:52:42 +00:00
sjg
5984bab77d Avoid unused variable warning 2018-02-13 19:37:30 +00:00
sjg
9d28f87b89 Do not treat .info as warning for -W
Reported by: lwhsu at FreeBSD.org
2018-02-12 21:38:09 +00:00
dholland
32cded6cc9 Typos. 2018-02-08 09:05:16 +00:00
sjg
156dbb683c Ensure VAR+=val on command line is handled correctly
If VAR is not previously set, call Var_Set to deal with
the special case of VAR_CMD.

If VAR is previously set, and ctxt is VAR_CMD we should do the update
even if VAR_FROM_CMD is set.
2017-12-08 03:36:42 +00:00
sjg
b958c10a1a Do not append to variable set on command line
POSIX requires that variables set on the command line
be immutable.
Var_Append needs to pass FIND_CMD and skip append
if found variable has VAR_FROM_CMD flag set.
2017-11-18 22:34:04 +00:00
sjg
adfbaec4c0 Ignore empty MAKEOBJDIR
Otherwise we end up with .OBJDIR = ${.CURDIR}/
which is quivalent, but fails the typial
.if ${.OBJDIR} == ${.CURDIR}
2017-10-28 21:54:54 +00:00
sjg
55844d12fe Ensure consistent results on different platforms.
With cycle.1.99 being written to stdout and
make: Graph cycles through `cycle.2.*`
to stderr, the order in which they are captured
varies on some platforms.
By redirecting stderr through the same pipe
as stdout we get more consistent result.
2017-10-08 20:44:19 +00:00
sjg
f20013011f Avoid full path meta file names for subdir of .OBJDIR 2017-08-10 21:07:48 +00:00
sjg
a5cccb4af8 Make compat.c handle SIGINT etc more like job.c
If there is a running child, pass the signal on, and
wait for it to exit before we self-terminate.

Reviewed by: christos
2017-07-20 19:29:54 +00:00
sjg
3dd087f31b Ensure that command output is always followed by newline,
even when filemon is not being used.

Tweak MAKE_META_IGNORE_PATTERNS matching to avoid using path name
with :L as it does not handle ':' in path names.

fgetLine: an extra check to avoid shrinking the buffer.
2017-07-09 04:54:00 +00:00
wiz
01869ca4d2 Remove workaround for ancient HTML generation code. 2017-07-03 21:28:48 +00:00
dholland
8d1c7950e6 Improve description of -V. Can probably be improved further. 2017-06-22 13:42:09 +00:00
wiz
a726a39b89 Whitespace fixes. 2017-06-22 13:34:13 +00:00
dholland
af10ba7a81 Document what the magic variable .MAKE.EXPAND_VARIABLES actually does. 2017-06-22 13:21:21 +00:00
christos
6b4650c2c5 Add -v variable that always expands variables; restore -V the way it was. 2017-06-19 19:58:24 +00:00
christos
5c6ef1cc66 make the code look like to 1.266 2017-06-19 15:49:21 +00:00
christos
0d284700aa Remove previous variable expansion code; sjg had already added the code to
do it. Note that the manual page already documents this behavior and does
not need to change:

	-dV -V VAR:	prints the raw variable
	-V VAR:		prints the expanded variable
2017-06-19 14:59:06 +00:00
christos
a8ded88f7a a variable that starts with \\ is not expanded. 2017-06-17 19:59:28 +00:00
christos
72acc73554 simplify 2017-06-17 16:34:07 +00:00
christos
bd56310bf6 -V: try to expand the variable again if the value contains a variable. 2017-06-17 15:49:56 +00:00
christos
20a3c31620 move some code out of the gigantic main function; no functional change. 2017-06-17 15:26:50 +00:00
maya
f4f257830c Don't prefix include guards by _, suggested by riastradh 2017-05-31 22:02:06 +00:00
maya
42fe4e0ac7 The previous change might actually be less generic.
prepend by _MAKE, to be sure.
2017-05-31 21:15:47 +00:00