Don't use VLA's in unit tests and API examples (#3002)
MSVC doesn't support C99 VLA (variable-length array). Use fixed size arrays in API examples and use JERRY_VLA macro in unit tests to make these tests buildable on Windows too. JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
This commit is contained in:
committed by
Robert Fancsik
parent
051febfed7
commit
9c7511221f
@@ -48,7 +48,7 @@ main (void)
|
||||
jerry_value_t is_global = jerry_get_property_by_index (res, 2);
|
||||
|
||||
jerry_size_t str_size = jerry_get_string_size (regex_res_str);
|
||||
jerry_char_t res_buff[str_size];
|
||||
JERRY_VLA (jerry_char_t, res_buff, str_size);
|
||||
jerry_size_t res_size = jerry_string_to_char_buffer (regex_res_str, res_buff, str_size);
|
||||
|
||||
const char expected_result[] = "something";
|
||||
|
||||
Reference in New Issue
Block a user