aboutsummaryrefslogblamecommitdiffstats
path: root/labs.c
blob: 7e1ea0a618023d95e278d8c1badc51e8653bf0a1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                         
                                      





                                                                                  
/* See LICENSE file for copyright and license details. */
#include "internal.h"


long int
liberror_labs(long int i)
{
#if LONG_MIN == -LONG_MAX
	return labs(i);
#else
	if (i != LONG_MIN)
		return labs(i);
	liberror_save_backtrace(NULL);
	liberror_set_error_errno("The absolute value of largest negative integer "
	                         "cannot be represented as a signed integer",
	                         "labs", EOVERFLOW);
	return i;
#endif
}