circumvent oneAPI 2025 warning in restart.c
1 unresolved thread
1 unresolved thread
Trying to compile with oneapi-2025.0.0 gets me this -Werror
:
restart.c:195:18: error: variable length array folded to constant array as an extension [-Werror,-Wgnu-folding-constant]
195 | char signature[strlen(SWIFT_RESTART_SIGNATURE) + 1];
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
this minor change circumvents it.
Merge request reports
Activity
added Intel compilation labels
assigned to @matthieu
191 191 if (stream == NULL) 192 192 error("Failed to open restart file: %s (%s)", filename, strerror(errno)); 193 193 194 /* Get our version and signature back. These should match. */ 195 char signature[strlen(SWIFT_RESTART_SIGNATURE) + 1]; 196 int len = strlen(SWIFT_RESTART_SIGNATURE); 197 restart_read_blocks(signature, len, 1, stream, NULL, "SWIFT signature"); 198 signature[len] = '\0'; 199 if (strncmp(signature, SWIFT_RESTART_SIGNATURE, len) != 0) 194 /* Get our version and signature back. These should match. 195 * Use static int here to avoid compiler warnings about gnu-extensions 196 * of folding a variable length array to constant array. */ 197 const static int sig_len = strlen(SWIFT_RESTART_SIGNATURE); changed this line in version 2 of the diff
mentioned in commit 362f580a
Please register or sign in to reply