unowned string array treated as char**
Submitted by Mikkel Kamstrup Erlandsen
Link to original bug (#622708)
Description
The following program produces compile time warnings from gcc:
namespace Test { public static int main (string[] args) { unowned string[] dirs = Environment.get_system_data_dirs();
return 0;
}
}
Gives:
foo.vala.c: In function ‘test_main’: foo.vala.c:25: warning: assignment from incompatible pointer type
And indeed on line 25 of the generated C it assigns a const char** to a char**.
The VAPI appears to be correct as it declares this function as
public static unowned string[] get_system_data_dirs ();