Skip to contentSkip to conversation

Move -Werror-implicit-function-declaration to

PATCH Superseded Petr Vorel 2 participants 9 messages Aug 2, 2019 – Aug 6, 2019

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

v2 cover Move -Werror-implicit-function-declaration to

Hi,

please see description in patches.

Travis build: https://travis-ci.org/pevik/ltp/builds/566982062

Kind regards,
Petr

Petr Vorel (4):
make: Remove C++ related flags
utils/ffsb: Add missing fhstat() signature + includes build.sh: Respect user defined CFLAGS and LDFLAGS make,travis: Remove -Werror-implicit-function-declaration

 .travis.yml                  |  3 ++-
 INSTALL                      |  4 +---
 build.sh                     |  5 +++--
 doc/build-system-guide.txt   | 10 ----------
 include/mk/config.mk.default |  4 ----
 include/mk/config.mk.in      |  4 ----
 include/mk/env_post.mk       |  4 ----
 utils/ffsb-6.0-rc2/fh.h      |  2 ++
 utils/ffsb-6.0-rc2/fileops.c |  1 +
 9 files changed, 9 insertions(+), 28 deletions(-)
Signature · 1 line
2.22.0
author
#1 lore raw

PATCH v2 1/4 make: Remove C++ related flags

as we have no C++ code. Removed:
CXXFLAGS, DEBUG_CXXFLAGS, OPT_CXXFLAGS, WCXXFLAGS

---
 INSTALL                      |  4 +---
 build.sh                     |  2 +-
 doc/build-system-guide.txt   | 10 ----------
 include/mk/config.mk.default |  4 ----
 include/mk/config.mk.in      |  4 ----
 5 files changed, 2 insertions(+), 22 deletions(-)
INSTALL +1 -3
index b2fe630bf..6e3b26e24 100644
@@ -239,7 +239,7 @@ Cross compiling
 ---------------
 
 To cross compile, you must specify the correct variables when running configure.
-e.g. CC, CXX, CXXFLAGS, LDFLAGS, etc...
+e.g. CC, LDFLAGS, etc...
 
 After configure has run, it will generate include/mk/config.mk. You can tweak
 settings in there if need be, but you should not specificy settings on the
@@ -264,8 +264,6 @@ The conventions enforced are standard ones. Here's a quick summary:
 
 CFLAGS   - used when compiling/linking C code, e.g. -D_GNU_SOURCE (no CPPFLAGS!)
 
-CXXFLAGS - used when compiling/linking C++ code (no CPPFLAGS!)
-
 CPPFLAGS - used when preprocessor is run (so C/C++ compiling with $(CPP)
 	   functions, e.g. -I$SYSROOT/usr/include -I$SYSROOT/include -I$SYSROOT
 
build.sh +1 -1
index ae3b86ff2..634ef51b5 100755
@@ -21,7 +21,7 @@ CC=gcc
 build_32()
 {
 	echo "===== 32-bit ${1}-tree build into $PREFIX ====="
-	build $1 CFLAGS="-m32" CXXFLAGS="-m32" LDFLAGS="-m32"
+	build $1 CFLAGS="-m32" LDFLAGS="-m32"
 }
 
 build_native()
doc/build-system-guide.txt +0 -10
index e9717f1ae..c4b36239b 100644
@@ -137,20 +137,14 @@ $(AR)			: The library archiver.
 
 $(CC)			: The system C compiler.
 
-$(CXX)			: The system C++ compiler.
-
 $(CPP)			: The system C preprocessor.
 
 $(CFLAGS)		: C compiler flags.
 
 $(CPPFLAGS)		: Preprocessor flags, e.g. -I arguments.
 
-$(CXXFLAGS)		: C++ compiler flags, e.g. -I arguments.
-
 $(DEBUG_CFLAGS)		: Debug flags to pass to $(CC), -g, etc.
 
-$(DEBUG_CXXFLAGS)	: Debug flags to pass to $(CXX).
-
 $(LD)			: The system linker (typically $(CC), but not
 			  necessarily).
 
@@ -179,14 +173,10 @@ $(OPT_CFLAGS)		: Optimization flags to pass into the C compiler, -O2,
 			  logic in the tree-optimization portion of the gcc
 			  compiler, from 3.3.x to 4.4.
 
-$(OPT_CXXFLAGS)		: Optimization flags to pass to the C++ compiler.
-
 $(RANLIB)		: What to run after archiving a library.
 
 $(WCFLAGS)		: Warning flags to pass to $(CC), e.g. -Werror,
 			  -Wall, etc.
-
-$(WCXXFLAGS)		: Same as $(WCFLAGS), but for $(CXX).
 -------------------------------------------------------------------------------
 
 Make System Variables
include/mk/config.mk.default +0 -4
index 0934d9453..857067cb3 100644
@@ -59,18 +59,14 @@ LDLIBS			:=
 LDFLAGS			:=
 
 DEBUG_CFLAGS		?= -g
-DEBUG_CXXFLAGS		?= $(DEBUG_CFLAGS)
 
 # Please see README.mk-devel about -fstrict-aliasing.
 OPT_CFLAGS		?= -O2 -fno-strict-aliasing -pipe
-OPT_CXXFLAGS		?= $(OPT_CFLAGS)
 
 WCFLAGS			?= -Wall
-WCXXFLAGS		?= $(WCFLAGS)
 
 LDFLAGS			+= $(WLDFLAGS)
 CFLAGS			+= $(DEBUG_CFLAGS) $(OPT_CFLAGS) $(WCFLAGS)
-CXXFLAGS		+= $(DEBUG_CXXFLAGS) $(OPT_CXXFLAGS) $(WCXXFLAGS)
 
 LINUX_VERSION		:=
 LINUX_DIR		:=
include/mk/config.mk.in +0 -4
index d55fe9602..0bc59887a 100644
@@ -63,18 +63,14 @@ LDLIBS			:= @LIBS@
 LDFLAGS			:= @LDFLAGS@
 
 DEBUG_CFLAGS		?= -g
-DEBUG_CXXFLAGS		?= $(DEBUG_CFLAGS)
 
 # Please see README.mk-devel about -fstrict-aliasing.
 OPT_CFLAGS		?= -O2 -fno-strict-aliasing -pipe
-OPT_CXXFLAGS		?= $(OPT_CFLAGS)
 
 WCFLAGS			?= -Wall -W @GCC_WARN_OLDSTYLE@
-WCXXFLAGS		?= $(WCFLAGS)
 
 LDFLAGS			+= $(WLDFLAGS)
 CFLAGS			+= $(DEBUG_CFLAGS) $(OPT_CFLAGS) $(WCFLAGS)
-CXXFLAGS		+= $(DEBUG_CXXFLAGS) $(OPT_CXXFLAGS) $(WCXXFLAGS)
 
 LINUX_VERSION		:= @LINUX_VERSION@
 LINUX_DIR		:= @LINUX_DIR@
Signature · 1 line
2.22.0
author
#2 lore raw

PATCH v2 2/4 utils/ffsb: Add missing fhstat() signature + includes

In reply to Petr Vorel

Need for build with -Werror-implicit-function-declaration

---
To be hones I'd rather delete this The Flexible Filesystem Benchmark (FFSB) (in utils/ffsb-6.0-rc2). Does anyone uses it?
If kept, I'd prefer to have it as a separate project in [1]

I probably have asked before and there is a paper from 2012 suggesting that someone used it 7 years ago [2][3]. There is also a fork, with just a few patches, no development now [4].

[1] https://github.com/linux-test-project/ffsb
[2] https://elinux.org/images/f/f7/FFSB_and_IOzone-_File_system_Benchmarking_Tools%2C_Features_and_Internals.pdf
[3] https://www.youtube.com/watch?v=jFhrteWcahI
[4] https://github.com/FFSB-Prime/ffsb

 utils/ffsb-6.0-rc2/fh.h      | 2 ++
 utils/ffsb-6.0-rc2/fileops.c | 1 +
 2 files changed, 3 insertions(+)
utils/ffsb-6.0-rc2/fh.h +2 -0
index 23a198bb8..29410c7ce 100644
@@ -19,6 +19,7 @@
 #define _FH_H_
 
 #include <inttypes.h>
+#include "ffsb_thread.h"
 
 struct ffsb_thread;
 struct ffsb_fs;
@@ -29,6 +30,7 @@ int fhopencreate(char *, struct ffsb_thread *, struct ffsb_fs *);
 int fhopenappend(char *, struct ffsb_thread *, struct ffsb_fs *);
 
 void fhread(int, void *, uint64_t, struct ffsb_thread *, struct ffsb_fs *);
+void fhstat(char *name, ffsb_thread_t * ft, ffsb_fs_t * fs);
 
 /* can only write up to size_t bytes at a time, so size is a uint32_t */
 void fhwrite(int, void *, uint32_t, struct ffsb_thread *, struct ffsb_fs *);
utils/ffsb-6.0-rc2/fileops.c +1 -0
index 3212c18b2..72e133a13 100644
@@ -30,6 +30,7 @@
 #include "ffsb.h"
 #include "fileops.h"
 #include "ffsb_op.h"
+#include "ffsb_thread.h"
 
 static void do_stats(struct timeval *start, struct timeval *end,
 		     ffsb_thread_t * ft, ffsb_fs_t * fs, syscall_t sys)
Signature · 1 line
2.22.0
#3 lore raw

PATCH v2 2/4 utils/ffsb: Add missing fhstat() signature + includes

Hi!

Quoted 3 lines

To be hones I'd rather delete this The Flexible Filesystem Benchmark (FFSB) (in utils/ffsb-6.0-rc2). Does anyone uses it?
If kept, I'd prefer to have it as a separate project in [1]

It's a dependency because the ext4-new-features tests use it.

But these tests already check for ffsb so we may as well remove it from LTP and either maintain it in a separate repo or point out our users to the fork.

Signature · 2 lines
Cyril Hrubis
[email protected]
author
#4 lore raw

PATCH v2 2/4 utils/ffsb: Add missing fhstat() signature + includes

Hi Cyril,

Quoted 10 lines

Hi!

Quoted 3 lines

To be hones I'd rather delete this The Flexible Filesystem Benchmark (FFSB) (in utils/ffsb-6.0-rc2). Does anyone uses it?
If kept, I'd prefer to have it as a separate project in [1]

It's a dependency because the ext4-new-features tests use it.

But these tests already check for ffsb so we may as well remove it from LTP and either maintain it in a separate repo or point out our users to the fork.

OK, I overlooked it's really installed. In that case I'd postpone the solution (hosting at separate project looks cleaner to me, but then we'd need to setup git subproject) and merge this unchanged.

Kind regards,
Petr

author
#5 lore raw

PATCH v2 3/4 build.sh: Respect user defined CFLAGS and LDFLAGS

In reply to Petr Vorel

Therefore it was needed to export them and not pass as a parameter.

It will be used for travis settings in next commit, but also can be handy for using build.sh in local development.

---
 build.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
build.sh +3 -2
index 634ef51b5..3da2adf55 100755
@@ -21,7 +21,8 @@ CC=gcc
 build_32()
 {
 	echo "===== 32-bit ${1}-tree build into $PREFIX ====="
-	build $1 CFLAGS="-m32" LDFLAGS="-m32"
+	export CFLAGS="-m32 $CFLAGS" LDFLAGS="-m32 $LDFLAGS"
+	build $1
 }
 
 build_native()
@@ -63,7 +64,7 @@ build_out_tree()
 
 	mkdir -p $build
 	cd $build
-	run_configure $tree/configure $CONFIGURE_OPTS_OUT_TREE CC="$CC" $@
+	run_configure $tree/configure $CONFIGURE_OPTS_OUT_TREE CC="$CC" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" $@
 
 	echo "=== build ==="
 	make $make_opts
Signature · 1 line
2.22.0
author
#6 lore raw

PATCH v2 4/4 make, travis: Remove -Werror-implicit-function-declaration

In reply to Petr Vorel

and add it to Travis CI builds.

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 only in Travis CI should be sufficient (although we lost lost this check for Android as we don't test it in our Travis CI setup).

---
Travis build: https://travis-ci.org/pevik/ltp/builds/566982062

 .travis.yml            | 3 ++-
 include/mk/env_post.mk | 4 ----
 2 files changed, 2 insertions(+), 5 deletions(-)
.travis.yml +2 -1
index a29551650..dcb5affb5 100644
@@ -79,5 +79,6 @@ script:
     - INSTALL="${DISTRO%%:*}"
     - INSTALL="${INSTALL%%/*}"
     - if [ ! "$TREE" ]; then TREE="in"; fi
+    - CFLAGS="-Werror-implicit-function-declaration"
     - case $VARIANT in cross-compile*) BUILD="cross";; i386) BUILD="32";; *) BUILD="native";; esac
-    - docker run -it ltp /bin/sh -c "cd travis && ./$INSTALL.sh && if [ \"$VARIANT\" ]; then ./$INSTALL.$VARIANT.sh; fi && ../build.sh -o $TREE -t $BUILD -c $CC"
+    - docker run -it ltp /bin/sh -c "cd travis && ./$INSTALL.sh && if [ \"$VARIANT\" ]; then ./$INSTALL.$VARIANT.sh; fi && CFLAGS='$CFLAGS' ../build.sh -o $TREE -t $BUILD -c $CC"
include/mk/env_post.mk +0 -4
index 913bdf5d1..f4169ad66 100644
@@ -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
Signature · 1 line
2.22.0
author
#7 lore raw

PATCH v2 4/4 make, travis: Remove -Werror-implicit-function-declaration

Hi,

Quoted 8 lines

and add it to Travis CI builds.

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 only in Travis CI should be sufficient (although we lost lost this check for Android as we don't test it in our Travis CI setup).

Quoted 4 lines

---
Travis build: https://travis-ci.org/pevik/ltp/builds/566982062

This one replaced by https://patchwork.ozlabs.org/patch/1142959/

Travis build: https://travis-ci.org/pevik/ltp/builds/568461383

Kind regards,
Petr

author
#8 lore raw

v2 cover Move -Werror-implicit-function-declaration to

In reply to Petr Vorel

Hi,

sorry, wrapped subject. It should have been
Move -Werror-implicit-function-declaration to Travis CI (from Makefile)

Kind regards,
Petr