Skip to content

Commit c9a0a1a

Browse files
committed
Fix discarding cstring literal constness
Signed-off-by: Anna Rift <[email protected]>
1 parent 096990f commit c9a0a1a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

runtime/src/launch/slurm-srun/launch-slurm-srun.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -443,12 +443,12 @@ static char* chpl_launch_create_command(int argc, char* argv[],
443443
snprintf(stdoutFileNoFmt, stdoutFileLen, "%s", outputfn);
444444
}
445445
else {
446-
char* format="%s.%s.out";
446+
const char* format="%s.%s.out";
447447
int stdoutFileLen = strlen(format) + strlen(argv[0]) + strlen("%j");
448448
stdoutFile = (char*)chpl_mem_allocMany(stdoutFileLen, sizeof(char),
449449
CHPL_RT_MD_FILENAME, -1, 0);
450450
snprintf(stdoutFile, stdoutFileLen, format, argv[0], "%j");
451-
char* tempArg = "$SLURM_JOB_ID";
451+
const char* tempArg = "$SLURM_JOB_ID";
452452
int stdoutFileNoFmtLen =
453453
strlen(format) + strlen(argv[0]) + strlen(tempArg);
454454
stdoutFileNoFmt = (char*)chpl_mem_allocMany(
@@ -466,8 +466,8 @@ static char* chpl_launch_create_command(int argc, char* argv[],
466466
// If we're buffering the output, set the temp output file name.
467467
// It's always <tmpDir>/binaryName.<jobID>.out.
468468
if (bufferStdout != NULL) {
469-
char* format = "%s/%s.%s.out";
470-
char* tempArg = "$SLURM_JOB_ID";
469+
const char* format = "%s/%s.%s.out";
470+
const char* tempArg = "$SLURM_JOB_ID";
471471
int tmpStdoutFileNoFmtLen =
472472
strlen(format) + strlen(tmpDir) + strlen(argv[0]) + strlen(tempArg);
473473
tmpStdoutFileNoFmt = (char*)chpl_mem_allocMany(
@@ -521,7 +521,7 @@ static char* chpl_launch_create_command(int argc, char* argv[],
521521

522522
// the baseCommand is what will call the batch file
523523
// that was just created
524-
char* format = "sbatch %s\n";
524+
const char* format = "sbatch %s\n";
525525
int baseCommandLen = strlen(slurmFilename) + strlen(format);
526526
baseCommand = (char*)chpl_mem_allocMany(baseCommandLen, sizeof(char),
527527
CHPL_RT_MD_COMMAND_BUFFER, -1, 0);
@@ -611,7 +611,7 @@ static char* chpl_launch_create_command(int argc, char* argv[],
611611
}
612612

613613
// launch the job using srun
614-
char* format = "srun %s";
614+
const char* format = "srun %s";
615615
int baseCommandLen = strlen(format) + len + 1;
616616
baseCommand = (char*)chpl_mem_allocMany(baseCommandLen, sizeof(char),
617617
CHPL_RT_MD_COMMAND_BUFFER, -1, 0);

0 commit comments

Comments
 (0)