All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v3 4/4] build: Move -Werror-implicit-function-declaration from make to build.sh
@ 2019-08-06 16:45 Petr Vorel
  2019-08-09  9:33 ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2019-08-06 16:45 UTC (permalink / raw)
  To: ltp

Previously it was passed only to Android build. Generally Werror flags
should be on for development but disabled for releases and production.
We don't have any configure flag stating development build, so using it
in build.sh should be sufficient as it can be used in both Travis CI
builds and local development.

+ respect CC variable in build.sh (for these lazy to pass it via -c flag)

Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Change v2->v3:
* move flag to build.sh, so it can be reused for local development
* respect CC

 build.sh               | 4 +++-
 include/mk/env_post.mk | 4 ----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/build.sh b/build.sh
index 3da2adf55..78845bf95 100755
--- a/build.sh
+++ b/build.sh
@@ -9,6 +9,9 @@
 
 set -e
 
+CFLAGS="${CFLAGS:--Werror-implicit-function-declaration}"
+CC="${CC:-gcc}"
+
 DEFAULT_PREFIX="$HOME/ltp-install"
 DEFAULT_BUILD="native"
 DEFAULT_TREE="in"
@@ -16,7 +19,6 @@ CONFIGURE_OPTS_IN_TREE="--with-open-posix-testsuite --with-realtime-testsuite"
 # TODO: open posix testsuite is currently broken in out-tree-build. Enable it once it's fixed.
 CONFIGURE_OPTS_OUT_TREE="--with-realtime-testsuite"
 MAKE_OPTS="-j$(getconf _NPROCESSORS_ONLN)"
-CC=gcc
 
 build_32()
 {
diff --git a/include/mk/env_post.mk b/include/mk/env_post.mk
index 913bdf5d1..f4169ad66 100644
--- a/include/mk/env_post.mk
+++ b/include/mk/env_post.mk
@@ -42,10 +42,6 @@ CPPFLAGS			+= -D__UCLIBC__ -DUCLINUX
 endif
 
 ifeq ($(ANDROID),1)
-# There are many undeclared functions, it's best not to accidentally overlook
-# them.
-CFLAGS				+= -Werror-implicit-function-declaration
-
 LDFLAGS				+= -L$(top_builddir)/lib/android_libpthread
 LDFLAGS				+= -L$(top_builddir)/lib/android_librt
 endif
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [LTP] [PATCH v3 4/4] build: Move -Werror-implicit-function-declaration from make to build.sh
  2019-08-06 16:45 [LTP] [PATCH v3 4/4] build: Move -Werror-implicit-function-declaration from make to build.sh Petr Vorel
@ 2019-08-09  9:33 ` Cyril Hrubis
  2019-08-09 10:07   ` Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2019-08-09  9:33 UTC (permalink / raw)
  To: ltp

Hi!
> Previously it was passed only to Android build. Generally Werror flags
> should be on for development but disabled for releases and production.
> We don't have any configure flag stating development build, so using it
> in build.sh should be sufficient as it can be used in both Travis CI
> builds and local development.
> 
> + respect CC variable in build.sh (for these lazy to pass it via -c flag)
> 
> Suggested-by: Cyril Hrubis <chrubis@suse.cz>
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Change v2->v3:
> * move flag to build.sh, so it can be reused for local development
> * respect CC
> 
>  build.sh               | 4 +++-
>  include/mk/env_post.mk | 4 ----
>  2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/build.sh b/build.sh
> index 3da2adf55..78845bf95 100755
> --- a/build.sh
> +++ b/build.sh
> @@ -9,6 +9,9 @@
>  
>  set -e
>  
> +CFLAGS="${CFLAGS:--Werror-implicit-function-declaration}"

Shouldn't this be -Werror=implicit-function-declaration ?

Hmm, looks like both variants actually work, but the gcc manual speaks
only about -Werror= one.


Otherwise it looks good, acked.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH v3 4/4] build: Move -Werror-implicit-function-declaration from make to build.sh
  2019-08-09  9:33 ` Cyril Hrubis
@ 2019-08-09 10:07   ` Petr Vorel
  2019-08-09 10:35     ` Cyril Hrubis
  0 siblings, 1 reply; 5+ messages in thread
From: Petr Vorel @ 2019-08-09 10:07 UTC (permalink / raw)
  To: ltp

Hi Cyril,

> > +CFLAGS="${CFLAGS:--Werror-implicit-function-declaration}"

> Shouldn't this be -Werror=implicit-function-declaration ?
Yes, it is. '${CFLAGS:-' part is POSIX shell substitute (${parameter:-[word]}
from [1]), the result is '-Werror=implicit-function-declaration' when CFLAGS is
empty or not set.
I might change it as

I might change it to more readable form:
DEFAULT_CFLAGS="-Werror-implicit-function-declaration"
CFLAGS="${CFLAGS:-$DEFAULT_CFLAGS}"

> Hmm, looks like both variants actually work, but the gcc manual speaks
> only about -Werror= one.


> Otherwise it looks good, acked.
Thx! Although I plan to send some RFC for moving ffsb as a subproject, it has a
low priority. So I'll merge this with your ack.

Kind regards,
Petr

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH v3 4/4] build: Move -Werror-implicit-function-declaration from make to build.sh
  2019-08-09 10:07   ` Petr Vorel
@ 2019-08-09 10:35     ` Cyril Hrubis
  2019-08-09 13:57       ` Petr Vorel
  0 siblings, 1 reply; 5+ messages in thread
From: Cyril Hrubis @ 2019-08-09 10:35 UTC (permalink / raw)
  To: ltp

Hi!
> > Shouldn't this be -Werror=implicit-function-declaration ?
> Yes, it is. '${CFLAGS:-' part is POSIX shell substitute (${parameter:-[word]}
> from [1]), the result is '-Werror=implicit-function-declaration' when CFLAGS is
> empty or not set.
> I might change it as

I meant the = after -Werror vs -.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [LTP] [PATCH v3 4/4] build: Move -Werror-implicit-function-declaration from make to build.sh
  2019-08-09 10:35     ` Cyril Hrubis
@ 2019-08-09 13:57       ` Petr Vorel
  0 siblings, 0 replies; 5+ messages in thread
From: Petr Vorel @ 2019-08-09 13:57 UTC (permalink / raw)
  To: ltp

Hi Cyril,

> > > Shouldn't this be -Werror=implicit-function-declaration ?
> > Yes, it is. '${CFLAGS:-' part is POSIX shell substitute (${parameter:-[word]}
> > from [1]), the result is '-Werror=implicit-function-declaration' when CFLAGS is
> > empty or not set.
> > I might change it as

> I meant the = after -Werror vs -.
Sure (I'm blind today). Changed to more common
-Werror=implicit-function-declaration and merged.

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-08-09 13:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-06 16:45 [LTP] [PATCH v3 4/4] build: Move -Werror-implicit-function-declaration from make to build.sh Petr Vorel
2019-08-09  9:33 ` Cyril Hrubis
2019-08-09 10:07   ` Petr Vorel
2019-08-09 10:35     ` Cyril Hrubis
2019-08-09 13:57       ` Petr Vorel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.