1*1f5207b7SJohn Levon /* 2*1f5207b7SJohn Levon * for array of char, ("...") as the initializer is an gcc language 3*1f5207b7SJohn Levon * extension. check that a parenthesized string initializer is handled 4*1f5207b7SJohn Levon * correctly and that -Wparen-string warns about it's use. 5*1f5207b7SJohn Levon */ 6*1f5207b7SJohn Levon static const char u[] = ("hello"); 7*1f5207b7SJohn Levon static const char v[] = {"hello"}; 8*1f5207b7SJohn Levon static const char v1[] = {("hello")}; 9*1f5207b7SJohn Levon static const char w[] = "hello"; 10*1f5207b7SJohn Levon static const char x[5] = "hello"; 11*1f5207b7SJohn Levon f(void)12*1f5207b7SJohn Levonstatic void f(void) 13*1f5207b7SJohn Levon { 14*1f5207b7SJohn Levon char a[1/(sizeof(u) == 6)]; 15*1f5207b7SJohn Levon char b[1/(sizeof(v) == 6)]; 16*1f5207b7SJohn Levon char c[1/(sizeof(w) == 6)]; 17*1f5207b7SJohn Levon char d[1/(sizeof(x) == 5)]; 18*1f5207b7SJohn Levon } 19*1f5207b7SJohn Levon /* 20*1f5207b7SJohn Levon * check-name: parenthesized string initializer 21*1f5207b7SJohn Levon * check-command: sparse -Wparen-string $file 22*1f5207b7SJohn Levon * 23*1f5207b7SJohn Levon * check-error-start 24*1f5207b7SJohn Levon init-char-array1.c:6:26: warning: array initialized from parenthesized string constant 25*1f5207b7SJohn Levon init-char-array1.c:8:28: warning: array initialized from parenthesized string constant 26*1f5207b7SJohn Levon * check-error-end 27*1f5207b7SJohn Levon */ 28