Skip to content

Commit f0fa805

Browse files
committed
CI: Fix failure on macos 26
Updated clang gives warnings: /Users/runner/work/AtomVM/AtomVM/src/platforms/generic_unix/lib/sys.c:484:40: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant] 484 | char port_driver_name[64 + strlen("avm_" | ~~~~~^~~~~~~~~~~~~ 485 | "_port_driver.so") | ~~~~~~~~~~~~~~~~~~ 486 | + 1]; | ~~~ /Users/runner/work/AtomVM/AtomVM/src/platforms/generic_unix/lib/sys.c:493:41: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant] 493 | char port_driver_func_name[64 + strlen("_create_port") + 1]; | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ 2 errors generated. Signed-off-by: Peter M <petermm@gmail.com>
1 parent 9be121e commit f0fa805

File tree

1 file changed

+2
-4
lines changed
  • src/platforms/generic_unix/lib

1 file changed

+2
-4
lines changed

src/platforms/generic_unix/lib/sys.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -525,16 +525,14 @@ Context *sys_create_port(GlobalContext *glb, const char *driver_name, term opts)
525525
#ifdef DYNLOAD_PORT_DRIVERS
526526
void *handle;
527527
{
528-
char port_driver_name[64 + strlen("avm_"
529-
"_port_driver.so")
530-
+ 1];
528+
char port_driver_name[64 + sizeof("avm_") - 1 + sizeof("_port_driver.so") - 1 + 1];
531529
snprintf(port_driver_name, sizeof(port_driver_name), "./avm_%s_port_driver.so", driver_name);
532530
handle = dlopen(port_driver_name, RTLD_NOW);
533531
if (!handle) {
534532
return NULL;
535533
}
536534
}
537-
char port_driver_func_name[64 + strlen("_create_port") + 1];
535+
char port_driver_func_name[64 + sizeof("_create_port") - 1 + 1];
538536
snprintf(port_driver_func_name, sizeof(port_driver_func_name), "%s_create_port", driver_name);
539537
create_port_t create_port
540538
= (create_port_t) CAST_VOID_TO_FUNC_PTR(dlsym(handle, port_driver_func_name));

0 commit comments

Comments
 (0)