[dev] [PATCH] Make build shut up about system() without return value check.

From: Alex Pilon <alp_AT_alexpilon.ca>
Date: Tue, 21 Apr 2015 10:27:24 -0400

    st.c:1321:2: warning: ignoring return value of function declared with warn_unused_result attribute [-Wunused-result]
            system(cmd);
            ^~~~~~ ~~~

Debatable whether an error here should case exit(EXIT_FAILURE). Just
preserving the existing behaviour for now.
---
 st.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/st.c b/st.c
index 4d08419..696aedd 100644
--- a/st.c
+++ b/st.c
_AT_@ -1318,7 +1318,8 @@ stty(void)
 		siz-= n + 1;
 	}
 	*q = '\0';
-	system(cmd);
+	if (system(cmd) != 0)
+	    perror("Couldn't call stty");
 }
 
 void
-- 
2.3.5

Received on Tue Apr 21 2015 - 16:27:24 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 21 2015 - 16:36:08 CEST