Skip to content

Commit bb5329d

Browse files
committed
build on z/OS
1 parent 2afefdc commit bb5329d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Support/zOSLibFunctions.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <sys/wait.h>
2020

2121

22-
char *signalName[] = {
22+
const char *signalName[] = {
2323
/* 0 */ nullptr,
2424
/* 1 */ "Hangup", // SIGHUP - Posix
2525
/* 2 */ "Interrupt", // SIGINT
@@ -65,8 +65,8 @@ char *signalName[] = {
6565
// z/OS Unix System Services does not have strsignal() support, so the
6666
// strsignal() function is implemented here.
6767
char *strsignal(int sig) {
68-
if (sig < sizeof(signalName)/sizeof(signalName[0]) && signalName[sig])
69-
return signalName[sig];
68+
if (static_cast<size_t>(sig) < sizeof(signalName)/sizeof(signalName[0]) && signalName[sig])
69+
return const_cast<char *>(signalName[sig]);
7070
static char msg[256];
7171
sprintf(msg, "Unknown signal %d", sig);
7272
return msg;

0 commit comments

Comments
 (0)