diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | main.cxx | 9 | ||||
-rw-r--r-- | tapsets.cxx | 3 |
3 files changed, 16 insertions, 6 deletions
@@ -1,3 +1,13 @@ +2006-08-23 Josh Stone <joshua.i.stone@intel.com> + + PR 3093 + From Eugeniy Meshcheryakov <eugen@debian.org>: + * main.cxx (main): Use setenv instead of putenv, since gcc 4.2 + doesn't like assigning string constants to char*. Also use + const char* for result from getenv. + * tapsets.cxx (dwflpp::setup): Copy string constant into a + local array, to fix gcc 4.2 warning. + 2006-08-22 Josh Stone <joshua.i.stone@intel.com> PR 3094 @@ -300,13 +300,12 @@ main (int argc, char * const argv []) int rc = 0; // override PATH and LC_ALL - char* path = "PATH=/bin:/sbin:/usr/bin:/usr/sbin"; - char* lc_all = "LC_ALL=C"; - rc = putenv (path) || putenv (lc_all); + const char *path = "/bin:/sbin:/usr/bin:/usr/sbin"; + rc = setenv("PATH", path, 1) || setenv("LC_ALL", "C", 1); if (rc) { const char* e = strerror (errno); - cerr << "setenv (\"" << path << "\" + \"" << lc_all << "\"): " + cerr << "setenv (\"PATH=" << path << "\" + \"LC_ALL=C\"): " << e << endl; } @@ -316,7 +315,7 @@ main (int argc, char * const argv []) // Create a temporary directory to build within. // Be careful with this, as "s.tmpdir" is "rm -rf"'d at the end. { - char* tmpdir_env = getenv("TMPDIR"); + const char* tmpdir_env = getenv("TMPDIR"); if (! tmpdir_env) tmpdir_env = "/tmp"; diff --git a/tapsets.cxx b/tapsets.cxx index 6d843d5b..2aa5e1b7 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -763,7 +763,8 @@ dwflpp void setup(bool kernel) { // XXX: this is where the session -R parameter could come in - static char* debuginfo_path = "-:.debug:/usr/lib/debug"; + static char debuginfo_path_arr[] = "-:.debug:/usr/lib/debug"; + static char *debuginfo_path = debuginfo_path_arr; static const Dwfl_Callbacks proc_callbacks = { |