Skip to content

Commit cc52476

Browse files
authored
Add missing const qualifiers from char* declarations (#27104)
[trivial, not reviewed] The code here is longstanding, but has recently started getting tested in GASNet's test configurations as a result of #26236, which makes greater use of slurm by default. They compile in developer mode to get maximal errors and warnings, and that tripped a warning for some `char* ... = "literal";` declarations that should've been `const char*`. This suggests that we should potentially be dialing up warnings in our own nightly testing, which is somewhat thematically related to Cray/chapel-private#3138
2 parents a9789eb + cc06f86 commit cc52476

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

runtime/src/launch/slurm-gasnetrun_common/slurm-gasnetrun_common.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static char* chpl_launch_create_command(int argc, char* argv[],
319319

320320
fclose(slurmFile);
321321
chmod(slurmFilename, 0755);
322-
char* format="sbatch %s\n";
322+
const char* format="sbatch %s\n";
323323
int baseCommandLen = strlen(slurmFilename) + strlen(format);
324324
baseCommand = (char*)chpl_mem_allocMany(baseCommandLen, sizeof(char),
325325
CHPL_RT_MD_COMMAND_BUFFER, -1, 0);
@@ -352,7 +352,7 @@ static char* chpl_launch_create_command(int argc, char* argv[],
352352
for (i=1; i<argc; i++) {
353353
chpl_append_to_cmd(&iCom, &len, " '%s'", argv[i]);
354354
}
355-
char* format = "salloc %s";
355+
const char* format = "salloc %s";
356356
int baseCommandLen = strlen(format) + len + 1;
357357
baseCommand = (char*)chpl_mem_allocMany(baseCommandLen, sizeof(char),
358358
CHPL_RT_MD_COMMAND_BUFFER, -1, 0);

0 commit comments

Comments
 (0)