aboutsummaryrefslogtreecommitdiff
path: root/gprofng/src
diff options
context:
space:
mode:
authorVladimir Mezentsev <vladimir.mezentsev@oracle.com>2022-12-19 01:01:04 -0800
committerVladimir Mezentsev <vladimir.mezentsev@oracle.com>2022-12-19 17:02:29 -0800
commit309b9a1abf77d9c643206f512d3db3ed7a23b854 (patch)
tree038b664167142959ea9df213b52143e509b5cf76 /gprofng/src
parentbd1473135af24ca37e3871771c6aaf4541c6987d (diff)
downloadgdb-309b9a1abf77d9c643206f512d3db3ed7a23b854.zip
gdb-309b9a1abf77d9c643206f512d3db3ed7a23b854.tar.gz
gdb-309b9a1abf77d9c643206f512d3db3ed7a23b854.tar.bz2
gprofng: PR29646 Various warnings
gprofng/ChangeLog 2022-12-19 Vladimir Mezentsev <vladimir.mezentsev@oracle.com> PR gprofng/29646 * common/core_pcbe.c: Fix missingReturn warning. * libcollector/iolib.c: Fix -Waddress warnings. * src/Settings.cc: Likewise. * src/checks.cc: Likewise. * libcollector/linetrace.c: Likewise. * libcollector/iotrace.c: Fix va_end_missing error. * libcollector/libcol_util.c: Fix uninitvar warning. * src/Command.cc: Fix arrayIndexOutOfBounds error. * src/Function.cc: Fix uninitStructMember warning. * src/ipc.cc: Fix -Wwrite-strings warnings.
Diffstat (limited to 'gprofng/src')
-rw-r--r--gprofng/src/Command.cc2
-rw-r--r--gprofng/src/Function.cc2
-rw-r--r--gprofng/src/Settings.cc2
-rw-r--r--gprofng/src/checks.cc2
-rw-r--r--gprofng/src/ipc.cc12
5 files changed, 11 insertions, 9 deletions
diff --git a/gprofng/src/Command.cc b/gprofng/src/Command.cc
index d1620d7..40530c2 100644
--- a/gprofng/src/Command.cc
+++ b/gprofng/src/Command.cc
@@ -222,7 +222,7 @@ static Cmdtable cmd_lst[] = { // list of commands
// like quit, but deletes all data loaded
{ HHELP, "xhelp", NULL, NULL, 0, &desc[HHELP]},
- { WHOAMI, "-whoami", NULL, NULL, 0, &desc[WHOAMI]},
+ { WHOAMI, "whoami", NULL, NULL, 0, NULL},
// these are not recognized at this point
{ LOADOBJECT, "segments", "pmap", NULL, 0, &desc[LOADOBJECT]},
diff --git a/gprofng/src/Function.cc b/gprofng/src/Function.cc
index b0e4a8f..0436e09 100644
--- a/gprofng/src/Function.cc
+++ b/gprofng/src/Function.cc
@@ -416,6 +416,8 @@ SrcInfo *
Function::new_srcInfo ()
{
SrcInfo *t = new SrcInfo ();
+ t->src_line = NULL;
+ t->included_from = NULL;
t->next = srcinfo_list;
srcinfo_list = t;
return t;
diff --git a/gprofng/src/Settings.cc b/gprofng/src/Settings.cc
index 572997f..53405a2 100644
--- a/gprofng/src/Settings.cc
+++ b/gprofng/src/Settings.cc
@@ -1257,7 +1257,7 @@ Settings::set_name_format (char *arg)
return CMD_BAD_ARG;
bool soname_fmt = false;
- if (colon && (colon + 1))
+ if (colon)
{
colon++;
if (!strcasecmp (colon, NTXT ("soname")))
diff --git a/gprofng/src/checks.cc b/gprofng/src/checks.cc
index 105821e..6a89a7b 100644
--- a/gprofng/src/checks.cc
+++ b/gprofng/src/checks.cc
@@ -326,7 +326,7 @@ collect::check_executable_arch (Elf *elf)
// now figure out if the platform can run it
struct utsname unbuf;
int r = uname (&unbuf);
- if (r == 0 && unbuf.machine && strstr (unbuf.machine, "_64") == NULL)
+ if (r == 0 && strstr (unbuf.machine, "_64") == NULL)
// machine can not run 64 bits, but this code is 64-bit
return EXEC_ELF_ARCH;
}
diff --git a/gprofng/src/ipc.cc b/gprofng/src/ipc.cc
index 06ba33d..180b510 100644
--- a/gprofng/src/ipc.cc
+++ b/gprofng/src/ipc.cc
@@ -69,16 +69,16 @@ bool2str (bool v)
return v ? "true" : "false";
}
-inline char*
-str2str (String v)
+inline const char*
+str2str (const char* v)
{
- return (char*) (v ? v : "NULL");
+ return v ? v : "NULL";
}
-inline char*
-str2s (String v)
+inline const char*
+str2s (const char* v)
{
- return (char*) (v ? v : "");
+ return v ? v : "";
}
inline DbeView *