From: Simon Marchi <simon.marchi@ericsson.com>
To: Pedro Alves <palves@redhat.com>, <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb: Use std::max and std::min throughout
Date: Thu, 15 Sep 2016 17:47:00 -0000 [thread overview]
Message-ID: <4e2937a7-f70d-574f-75b8-78faab90fddc@ericsson.com> (raw)
In-Reply-To: <1473958336-23920-1-git-send-email-palves@redhat.com>
On 16-09-15 12:52 PM, Pedro Alves wrote:
> Otherwise including <string> or some other C++ header is broken.
> E.g.:
>
> In file included from /opt/gcc/include/c++/7.0.0/bits/char_traits.h:39:0,
> from /opt/gcc/include/c++/7.0.0/string:40,
> from /home/pedro/gdb/mygit/cxx-convertion/src/gdb/infrun.c:68:
> /opt/gcc/include/c++/7.0.0/bits/stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
> min(const _Tp& __a, const _Tp& __b, _Compare __comp)
> ^
> /opt/gcc/include/c++/7.0.0/bits/stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2
> max(const _Tp& __a, const _Tp& __b, _Compare __comp)
> ^
> In file included from .../src/gdb/infrun.c:21:0:
>
> To the best of my grepping abilities, I believe I adjusted all min/max
> calls.
If you missed one in the code you compile, it would show up as a compilation error.
For the rest (native files?), if you missed one it will be an easy fix.
There are a few places where it makes the lines too long. I personally don't mind,
since I finally upgraded to a terminal wider than 80 characters, but it shouldn't be
too long to fix. If you don't have your own already, may I suggest using this command
line to find long lines?
$ git show | sed "s|\t| |g" | sed -r 's|^\+(.{81,1000})|+\1 TOO LONG|g' | less
It displays "TOO LONG" at the end of the line when an added line overflows 80 chars.
> gdb/ChangeLog:
> 2016-09-15 Pedro Alves <palves@redhat.com>
>
> * defs.h (min, max): Delete.
> * aarch64-tdep.c: Include <algorigthm> and use std::min and
algorigthm -> algorithm.
> std::max throughout.
> * aarch64-tdep.c: Likewise.
> * alpha-tdep.c: Likewise.
> * amd64-tdep.c: Likewise.
> * amd64-windows-tdep.c: Likewise.
> * arm-tdep.c: Likewise.
> * avr-tdep.c: Likewise.
> * breakpoint.c: Likewise.
> * btrace.c: Likewise.
> * ctf.c: Likewise.
> * disasm.c: Likewise.
> * doublest.c: Likewise.
> * dwarf2loc.c: Likewise.
> * dwarf2read.c: Likewise.
> * environ.c: Likewise.
> * exec.c: Likewise.
> * f-exp.y: Likewise.
> * findcmd.c: Likewise.
> * ft32-tdep.c: Likewise.
> * gcore.c: Likewise.
> * hppa-tdep.c: Likewise.
> * i386-darwin-tdep.c: Likewise.
> * i386-tdep.c: Likewise.
> * linux-thread-db.c: Likewise.
> * lm32-tdep.c: Likewise.
> * m32r-tdep.c: Likewise.
> * m88k-tdep.c: Likewise.
> * memrange.c: Likewise.
> * minidebug.c: Likewise.
> * mips-tdep.c: Likewise.
> * moxie-tdep.c: Likewise.
> * nds32-tdep.c: Likewise.
> * nios2-tdep.c: Likewise.
> * nto-procfs.c: Likewise.
> * parse.c: Likewise.
> * ppc-sysv-tdep.c: Likewise.
> * probe.c: Likewise.
> * record-btrace.c: Likewise.
> * remote.c: Likewise.
> * rs6000-tdep.c: Likewise.
> * rx-tdep.c: Likewise.
> * s390-linux-nat.c: Likewise.
> * s390-linux-tdep.c: Likewise.
> * ser-tcp.c: Likewise.
> * sh-tdep.c: Likewise.
> * sh64-tdep.c: Likewise.
> * source.c: Likewise.
> * sparc-tdep.c: Likewise.
> * symfile.c: Likewise.
> * target-memory.c: Likewise.
> * target.c: Likewise.
> * tic6x-tdep.c: Likewise.
> * tilegx-tdep.c: Likewise.
> * tracefile-tfile.c: Likewise.
> * tracepoint.c: Likewise.
> * valprint.c: Likewise.
> * value.c: Likewise.
> * xtensa-tdep.c: Likewise.
> * cli/cli-cmds.c: Likewise.
> * compile/compile-object-load.c: Likewise.
I noticed that you didn't list all affected functions in your ChangeLog,
only the files. I think it makes sense for those across-the-board changes,
I'll probably do the same some day :).
next prev parent reply other threads:[~2016-09-15 17:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-15 16:52 Pedro Alves
2016-09-15 17:47 ` Simon Marchi [this message]
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 ` [pushed] gdb/s390: Fix build breakage due to std::min/std::max usage without header Pedro Alves
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=4e2937a7-f70d-574f-75b8-78faab90fddc@ericsson.com \
--to=simon.marchi@ericsson.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/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