[v2,3/7] examples/performance-thread: remove warning disabling

Message ID 20191015133513.11376-4-bruce.richardson@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series support all examples in a meson build |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Bruce Richardson Oct. 15, 2019, 1:35 p.m. UTC
  The warnings about functions not returning values can be removed from the
code by just adding an attribute to the function to specifies it doesn't
return. The GCC bug referenced in the makefile which prevents this from
working has been fixed for >10 years according to bugzilla.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 examples/performance-thread/l3fwd-thread/Makefile | 6 ------
 examples/performance-thread/l3fwd-thread/main.c   | 4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)
  

Patch

diff --git a/examples/performance-thread/l3fwd-thread/Makefile b/examples/performance-thread/l3fwd-thread/Makefile
index 1a1c95829..b14b21e30 100644
--- a/examples/performance-thread/l3fwd-thread/Makefile
+++ b/examples/performance-thread/l3fwd-thread/Makefile
@@ -20,10 +20,4 @@  include $(RTE_SDK)/examples/performance-thread/common/common.mk
 
 CFLAGS += -O3 -g $(USER_FLAGS) $(INCLUDES) $(WERROR_FLAGS)
 
-# workaround for a gcc bug with noreturn attribute
-# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12603
-#ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
-CFLAGS_main.o += -Wno-return-type
-#endif
-
 include $(RTE_SDK)/mk/rte.extapp.mk
diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c
index 122c63244..ad540fd84 100644
--- a/examples/performance-thread/l3fwd-thread/main.c
+++ b/examples/performance-thread/l3fwd-thread/main.c
@@ -1877,7 +1877,7 @@  process_burst(struct rte_mbuf *pkts_burst[MAX_PKT_BURST], int nb_rx,
 /*
  * CPU-load stats collector
  */
-static int
+static int __attribute__((noreturn))
 cpu_load_collector(__rte_unused void *arg) {
 	unsigned i, j, k;
 	uint64_t hits;
@@ -2299,7 +2299,7 @@  sched_spawner(__rte_unused void *arg) {
 }
 
 /* main processing loop */
-static int
+static int __attribute__((noreturn))
 pthread_tx(void *dummy)
 {
 	struct rte_mbuf *pkts_burst[MAX_PKT_BURST];