From patchwork Thu Jun 2 14:14:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Turney X-Patchwork-Id: 12721 Received: (qmail 48054 invoked by alias); 2 Jun 2016 14:15:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 48029 invoked by uid 89); 2 Jun 2016 14:15:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL, BAYES_40, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=U*jon.turney, sk:jon.tur, D*dronecode.org.uk, jonturneydronecodeorguk X-HELO: rgout0606.bt.lon5.cpcloud.co.uk Received: from rgout0606.bt.lon5.cpcloud.co.uk (HELO rgout0606.bt.lon5.cpcloud.co.uk) (65.20.0.133) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 02 Jun 2016 14:15:21 +0000 X-OWM-Source-IP: 86.141.128.254 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-CTCH-RefID: str=0001.0A090202.57503F75.0045, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-Junkmail-Premium-Raw: score=27/50, refid=2.7.2:2016.5.27.102118:17:27.888, ip=86.141.128.254, rules=__HAS_FROM, __TO_MALFORMED_2, __TO_NO_NAME, __HAS_CC_HDR, __SUBJ_ALPHA_END, __HAS_MSGID, __SANE_MSGID, __HAS_X_MAILER, __ANY_URI, __URI_NO_WWW, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_2000_2999, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, __URI_NS, SXL_IP_DYNAMIC[254.128.141.86.fur], HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, RDNS_SUSP_GENERIC, MULTIPLE_RCPTS_RND, RDNS_SUSP, BODY_SIZE_7000_LESS, NO_URI_HTTPS, LEGITIMATE_NEGATE X-CTCH-Spam: Unknown Received: from localhost.localdomain (86.141.128.254) by rgout06.bt.lon5.cpcloud.co.uk (8.6.122.06) (authenticated as jonturney@btinternet.com) id 57472EEC010B022E; Thu, 2 Jun 2016 15:15:17 +0100 From: Jon Turney To: gdb-patches@sourceware.org Cc: Jon Turney Subject: [PATCH] Fix C++ build for Cygwin Date: Thu, 2 Jun 2016 14:14:57 +0000 Message-Id: <20160602141457.7608-1-jon.turney@dronecode.org.uk> gdb/ChangeLog: 2016-06-02 Jon Turney * windows-nat.c (handle_output_debug_string): return type of gdb_signal_from_host() is gdb_signal, not an int. (windows_get_exec_module_filename): Add pointer casts for C++. gdb/gdbserver/ChangeLog: 2016-06-02 Jon Turney * win32-low.c (win32_create_inferior): Add pointer casts for C++. --- gdb/ChangeLog | 6 ++++++ gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/win32-low.c | 4 ++-- gdb/windows-nat.c | 4 ++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c index e60be5a..70abfcd 100644 --- a/gdb/gdbserver/win32-low.c +++ b/gdb/gdbserver/win32-low.c @@ -642,8 +642,8 @@ win32_create_inferior (char *program, char **program_args) if (path_ptr) { int size = cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, NULL, 0); - orig_path = alloca (strlen (path_ptr) + 1); - new_path = alloca (size); + orig_path = (char *) alloca (strlen (path_ptr) + 1); + new_path = (char *) alloca (size); strcpy (orig_path, path_ptr); cygwin_conv_path_list (CCP_POSIX_TO_WIN_A, path_ptr, new_path, size); setenv ("PATH", new_path, 1); diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 2e8a777..149403a 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -864,7 +864,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus) to treat this like a real signal. */ char *p; int sig = strtol (s + sizeof (_CYGWIN_SIGNAL_STRING) - 1, &p, 0); - int gotasig = gdb_signal_from_host (sig); + gdb_signal gotasig = gdb_signal_from_host (sig); ourstatus->value.sig = gotasig; if (gotasig) @@ -1894,7 +1894,7 @@ windows_get_exec_module_filename (char *exe_name_ret, size_t exe_name_max_len) /* Cygwin prefers that the path be in /x/y/z format, so extract the filename into a temporary buffer first, and then convert it to POSIX format into the destination buffer. */ - cygwin_buf_t *pathbuf = alloca (exe_name_max_len * sizeof (cygwin_buf_t)); + cygwin_buf_t *pathbuf = (cygwin_buf_t *) alloca (exe_name_max_len * sizeof (cygwin_buf_t)); len = GetModuleFileNameEx (current_process_handle, dh_buf, pathbuf, exe_name_max_len);