Commits

immerrr committed 52c767a

Avoid possible "unused parameter" warnings in check_c/check_cc boilerplates

When CFLAGS/CXXFLAGS contains '-Wextra -Werror', such warnings are reported
and become errors, which causes respective checks to fail.

Signed-off-by: Thomas Nagy <tnagy2pow10@gmail.com>

Comments (0)

Files changed (1)

waflib/Tools/c_config.py

 }
 
 SNIP_FUNCTION = '''
-	int main(int argc, char **argv) {
+int main(int argc, char ** argv) {
+	(void)argc; (void)argv;
 	void *p;
 	p=(void*)(%s);
 	return 0;
 
 SNIP_TYPE = '''
 int main(int argc, char **argv) {
+	(void)argc; (void)argv;
 	if ((%(type_name)s *) 0) return 0;
 	if (sizeof (%(type_name)s)) return 0;
 	return 1;
 
 SNIP_EMPTY_PROGRAM = '''
 int main(int argc, char **argv) {
+	(void)argc; (void)argv;
 	return 0;
 }
 '''
 
 SNIP_FIELD = '''
 int main(int argc, char **argv) {
+	(void)argc; (void)argv;
 	char *off;
 	off = (char*) &((%(type_name)s*)0)->%(field_name)s;
 	return (size_t) off < sizeof(%(type_name)s);