Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [pushed] gdb/s390: Fix build breakage due to std::min/std::max usage without header
Date: Sun, 18 Sep 2016 23:37:00 -0000	[thread overview]
Message-ID: <545685b9-b9b5-a62e-3d79-a4d0e15e66d5@redhat.com> (raw)
In-Reply-To: <77416303-1ed7-fe71-7a52-1dbd1ca6aa56@redhat.com>

On 09/16/2016 08:00 PM, Pedro Alves wrote:

> From 325fac504a327de9c46a4e5cf9c88ece9d9d7701 Mon Sep 17 00:00:00 2001
> From: Pedro Alves <palves@redhat.com>
> Date: Fri, 16 Sep 2016 19:55:17 +0100
> Subject: [PATCH] gdb: Use std::min and std::max throughout

This broke the build on s390.   I've pushed the obvious fix below.

Hindsight is showing I have lost a good opportunity to try the trybot...

From 93689493b376c4e5616c1679733619f96202c369 Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Mon, 19 Sep 2016 00:30:30 +0100
Subject: [PATCH] gdb/s390: Fix build breakage due to std::min/std::max usage
 without header

  [...]
  .../gdb/s390-linux-nat.c: In function 'void s390_prepare_to_resume(lwp_info*)':
  .../gdb/s390-linux-nat.c:703:20: error: 'min' is not a member of 'std'
      watch_lo_addr = std::min (watch_lo_addr, area->lo_addr);
  [...]

gdb/ChangeLog:
2016-09-18  Pedro Alves  <palves@redhat.com>

	* s390-linux-nat.c: Include <algorithm>.
---
 gdb/ChangeLog        | 4 ++++
 gdb/s390-linux-nat.c | 1 +
 2 files changed, 5 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f86e0a4..830d5de 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
 2016-09-18  Pedro Alves  <palves@redhat.com>
 
+	* s390-linux-nat.c: Include <algorithm>.
+
+2016-09-18  Pedro Alves  <palves@redhat.com>
+
 	* breakpoint.c (hardware_watchpoint_inserted_in_range): Explicitly
 	specify the std:min/std::max specialization.
 	* exec.c (section_table_read_available_memory): Likewise.
diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
index 687502c..9abb5c2 100644
--- a/gdb/s390-linux-nat.c
+++ b/gdb/s390-linux-nat.c
@@ -39,6 +39,7 @@
 #include <sys/procfs.h>
 #include <sys/ucontext.h>
 #include <elf.h>
+#include <algorithm>
 
 /* Per-thread arch-specific data.  */
 
-- 
2.5.5



  parent reply	other threads:[~2016-09-18 23:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-15 16:52 [PATCH] gdb: Use std::max and std::min throughout Pedro Alves
2016-09-15 17:47 ` Simon Marchi
2016-09-16 19:01   ` Pedro Alves
2016-09-18 23:26     ` [pushed] gdb: Fix std::{min, max}-related build breakage on 32-bit hosts Pedro Alves
2016-09-18 23:37     ` Pedro Alves [this message]
2016-09-19 11:47     ` [PATCH] gdb: Use std::max and std::min throughout Ulrich Weigand
2016-09-19 13:36       ` Pedro Alves
2016-09-19 13:44         ` Pedro Alves
2016-09-19 14:02           ` Pedro Alves
2016-09-19 14:56         ` Ulrich Weigand
2016-09-19 15:23           ` Pedro Alves
2016-09-19 15:59             ` [pushed] gdb: Fix build breakage with GCC 4.1 and --disable-nls Pedro Alves
2016-09-19 16:18               ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=545685b9-b9b5-a62e-3d79-a4d0e15e66d5@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox