aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-02-27 16:42:17 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-02-27 16:45:34 +0000
commit3104d9ee223133b9f5be4ec96b3f986e4fbc893e (patch)
treeb594823bfbc8c77dfe345d5455fa3b9dd03e3cb2 /gdb
parent736990c44277615e47d5dfab523c70488911624d (diff)
downloadgdb-3104d9ee223133b9f5be4ec96b3f986e4fbc893e.zip
gdb-3104d9ee223133b9f5be4ec96b3f986e4fbc893e.tar.gz
gdb-3104d9ee223133b9f5be4ec96b3f986e4fbc893e.tar.bz2
gdb: Use std::abs instead of abs on LONGEST types
Use std::abs so that we get the C++ overloaded version that matches the argument type instead of the C abs function which is only for int arguments. There should be no user visible change after this commit. gdb/ChangeLog: * gdbtypes.c (create_array_type_with_stride): Use std::abs not abs.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/gdbtypes.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2f92b0a..4376161 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-02-27 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gdbtypes.c (create_array_type_with_stride): Use std::abs not
+ abs.
+
2020-02-26 Tom Tromey <tom@tromey.com>
* dwarf2/read.c (struct dwarf2_include_psymtab): New.
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index ef110b3..d89df9f 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1249,9 +1249,9 @@ create_array_type_with_stride (struct type *result_type,
negative stride in Fortran (this doesn't mean anything
special, it's still just a single element array) so do
consider that case when touching this code. */
- LONGEST element_count = abs (high_bound - low_bound + 1);
+ LONGEST element_count = std::abs (high_bound - low_bound + 1);
TYPE_LENGTH (result_type)
- = ((abs (stride) * element_count) + 7) / 8;
+ = ((std::abs (stride) * element_count) + 7) / 8;
}
else
TYPE_LENGTH (result_type) =