[PATCH v2 0/2] (Re-)instate some build guards

Johannes Schindelin johannes.schindelin at gmx.de
Fri Jul 14 20:25:50 UTC 2017


It would appear that some compile-time flags are used as if they were
runtime flags, i.e. they are used in if (...) constructs, not in
`#if ... #endif` guards.

The effect *should* be the same, except when switching off optimization
(e.g. for debugging) where dead code is not removed, possibly leading to
build errors where features are disabled because the required functions
are unavailable.

Changes since v1:

- enclosed also the `jobless--;` statement in the #if JOBS ... #endif that
  clearly was part of the `if()` already inside that clause.

- skipped 2/3, as it was already applied as 7d7c7bb22 (libbb: hide
  getnetbyaddr() inside "#if ENABLE_FEATURE_ETC_NETWORKS" block,
  2017-07-14) (silently dropping my authorship, and smooshing it
  together with plenty of `#if DEBUG bb_error_msg(...) #endif` =>
  `dbg(...)` conversions, making it hard to see the functional change)


Johannes Schindelin (2):
  copyfd: reinstate proper guard around munmap()
  ash: use JOBS as the compile time option it actually is

 libbb/copyfd.c |  2 ++
 shell/ash.c    | 12 +++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)


base-commit: 7d7c7bb2205b92359ac88f3469d3af672e2be929
Published-As: https://github.com/dscho/busybox-w32/releases/tag/busybox-build-guards-v2
Fetch-It-Via: git fetch https://github.com/dscho/busybox-w32 busybox-build-guards-v2

Interdiff vs v1:
 diff --git a/shell/ash.c b/shell/ash.c
 index 5c8216331..b0c7dac54 100644
 --- a/shell/ash.c
 +++ b/shell/ash.c
 @@ -4188,8 +4188,8 @@ dowait(int block, struct job *job)
  	/* The process wasn't found in job list */
  #if JOBS
  	if (!WIFSTOPPED(status))
 -#endif
  		jobless--;
 +#endif
   out:
  	INT_ON;
  
-- 
2.13.3.windows.1.13.gaf0c2223da0



More information about the busybox mailing list