Fixes "deprecated conversion from string constant to 'char*'" compiler warning. diff --git a/src/os/linux/vm/jvm_linux.cpp b/src/os/linux/vm/jvm_linux.cpp --- a/src/os/linux/vm/jvm_linux.cpp +++ b/src/os/linux/vm/jvm_linux.cpp @@ -132,7 +132,7 @@ */ struct siglabel { - char *name; + const char *name; int number; }; diff --git a/src/os/linux/vm/os_linux.cpp b/src/os/linux/vm/os_linux.cpp --- a/src/os/linux/vm/os_linux.cpp +++ b/src/os/linux/vm/os_linux.cpp @@ -213,7 +213,7 @@ // the system call returns 1. This causes the VM to act as if it is // a single processor and elide locking (see is_MP() call). static bool unsafe_chroot_detected = false; -static char *unstable_chroot_error = "/proc file system not found.\n" +static const char *unstable_chroot_error = "/proc file system not found.\n" "Java may be unstable running multithreaded in a chroot " "environment on Linux when /proc filesystem is not mounted."; @@ -557,13 +557,13 @@ // NPTL: if (sysconf(_SC_THREAD_THREADS_MAX) > 0) { free(str); - str = "linuxthreads"; + str = (char *) "linuxthreads"; } } os::Linux::set_libpthread_version(str); } else { // glibc before 2.3.2 only has LinuxThreads. - os::Linux::set_libpthread_version("linuxthreads"); + os::Linux::set_libpthread_version((char *) "linuxthreads"); } if (strstr(libpthread_version(), "NPTL")) { @@ -4538,7 +4538,7 @@ // Unlike system(), this function can be called from signal handler. It // doesn't block SIGINT et al. int os::fork_and_exec(char* cmd) { - char * argv[4]; + const char * argv[4]; argv[0] = "sh"; argv[1] = "-c"; argv[2] = cmd;