Skip to contentSkip to conversation

app: fix gcc -O3 compiler errors

PATCH Applied Keith Wiles 3 participants 3 messages Aug 15, 2017 – Oct 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app: fix gcc -O3 compiler errors

When using EXTRA_CFLAGS="-g -O3" in the build the -O3 causes compiler warnings for these two applications. Using Ubuntu 17.04 gcc compiler.

---
 app/proc_info/main.c                     | 4 +++-
 app/test-crypto-perf/cperf_test_verify.c | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)
app/proc_info/main.c +3 -1
index 8b753a2ee..12566e27d 100644
@@ -524,7 +524,9 @@ nic_xstats_display(uint8_t port_id)
 			sprintf(buf, "PUTVAL %s/dpdkstat-port.%u/%s-%s N:%"
 				PRIu64"\n", host_id, port_id, counter_type,
 				xstats_names[i].name, values[i]);
-			write(stdout_fd, buf, strlen(buf));
+			ret = write(stdout_fd, buf, strlen(buf));
+			if (ret < 0)
+				goto err;
 		} else {
 			printf("%s: %"PRIu64"\n", xstats_names[i].name,
 					values[i]);
app/test-crypto-perf/cperf_test_verify.c +2 -0
index a314646c2..4548e7241 100644
@@ -366,6 +366,8 @@ cperf_verify_op(struct rte_crypto_op *op,
 		auth = 1;
 		auth_offset = vector->aad.length + options->test_buffer_size;
 		break;
+	default:
+		return 1;
 	}
 
 	if (cipher == 1) {
Signature · 1 line
2.11.0
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Keith Wiles

When using EXTRA_CFLAGS="-g -O3" in the build the -O3 causes compiler warnings for these two applications. Using Ubuntu 17.04 gcc compiler.

Signed-off-by Keith Wiles <keith.wiles at intel.com>

---

#2 lore raw

04/10/2017 14:59, Burakov, Anatoly:

Quoted 8 lines · Keith Wiles
Quoted 5 lines

When using EXTRA_CFLAGS="-g -O3" in the build the -O3 causes compiler warnings for these two applications. Using Ubuntu 17.04 gcc compiler.

Signed-off-by Keith Wiles <keith.wiles at intel.com>

Rebased and re-targetted to procinfo only as the crypto app is already fixed by Olivier for -Og compilation.

Applied, thanks