[PUSHED] gdb: Use std::abs instead of abs on LONGEST types

Pedro Alves palves@redhat.com
Thu Feb 27 19:06:00 GMT 2020


On 2/27/20 4:46 PM, Andrew Burgess wrote:
> 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.

Note that stdlib.h/stdmath.h are supposed to provide the overloads in
the global namespace as well; the standard requires it.  Older
GCCs got that wrong (e.g. 4.8), but more modern GCCs get it right.

Just a FYI, the patch is fine.

> 
> There should be no user visible change after this commit.
> 
> gdb/ChangeLog:
> 
> 	* gdbtypes.c (create_array_type_with_stride): Use std::abs not
> 	abs.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list