This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Avoid compiler warning in latest patch


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6261fb30a9780fae87d631c1da4d77efa43fe329

commit 6261fb30a9780fae87d631c1da4d77efa43fe329
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Mon Jun 8 21:55:11 2015 +0200

    Avoid compiler warning in latest patch
    
    	* pinfo.cc (_pinfo::cwd): Initialize s to avoid comiler warning.
    	(_pinfo::cmdline): Ditto.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/ChangeLog | 5 +++++
 winsup/cygwin/pinfo.cc  | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 10717e3..091fa32 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
 2015-06-08  Corinna Vinschen  <corinna@vinschen.de>
 
+	* pinfo.cc (_pinfo::cwd): Initialize s to avoid comiler warning.
+	(_pinfo::cmdline): Ditto.
+
+2015-06-08  Corinna Vinschen  <corinna@vinschen.de>
+
 	* pinfo.cc (_pinfo::root): Fake default root for native processes.
 	(open_commune_proc_parms): New helper function to access process
 	parameter block.
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index f7fd9f0..038937e 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -892,7 +892,7 @@ open_commune_proc_parms (DWORD pid, PRTL_USER_PROCESS_PARAMETERS prupp)
 char *
 _pinfo::cwd (size_t& n)
 {
-  char *s;
+  char *s = NULL;
   if (!this || !pid)
     return NULL;
   if (ISSTATE (this, PID_NOTCYGWIN))
@@ -938,7 +938,7 @@ _pinfo::cwd (size_t& n)
 char *
 _pinfo::cmdline (size_t& n)
 {
-  char *s;
+  char *s = NULL;
   if (!this || !pid)
     return NULL;
   if (ISSTATE (this, PID_NOTCYGWIN))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]