[Piglit] [PATCH] cl-program-tester: Fix regexec usage.

Vinson Lee vlee at freedesktop.org
Fri Feb 28 19:07:37 PST 2014


This patch fixes this GCC warning.

program-tester.c: In function ‘parse_name’:
program-tester.c:1131:2: warning: passing argument 4 of ‘regexec’ from incompatible pointer type [enabled by default]
  if (!regexec(&regex, input, 1, &pmatch, 0)) {
  ^
program-tester.c:33:0:
/usr/include/regex.h:578:12: note: expected ‘struct regmatch_t * __restrict__’ but argument is of type ‘struct regmatch_t (*)[1]’
 extern int regexec (const regex_t *__restrict __preg,
            ^

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/cl/program/program-tester.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/cl/program/program-tester.c b/tests/cl/program/program-tester.c
index 6ff3251..834c6c8 100644
--- a/tests/cl/program/program-tester.c
+++ b/tests/cl/program/program-tester.c
@@ -1128,7 +1128,7 @@ parse_name(const char *input)
 		return NULL;
 	}
 
-	if (!regexec(&regex, input, 1, &pmatch, 0)) {
+	if (!regexec(&regex, input, 1, pmatch, 0)) {
 		char bad_char = *(input + pmatch[0].rm_so);
 		fprintf(stderr,	"Illegal character in test name '%s': %c\n",
 							input, bad_char);
-- 
1.8.3.2



More information about the Piglit mailing list