Bug #70340 [Asn->Csd]: use of abs() instead of llabs() for long long
| From: | nikic@php.net | Date: | Thu, 16 Apr 2020 12:49:44 +0000 |
| Subject: | Bug #70340 [Asn->Csd]: use of abs() instead of llabs() for long long | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-226614@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70340&edit=1
ID: 70340
Updated by: nikic@php.net
Reported by: andreas at fink dot org
Summary: use of abs() instead of llabs() for long long
-Status: Assigned
+Status: Closed
Type: Bug
Package: Compile Warning
Operating System: OS X 10.11
PHP Version: 7.0.0RC1
Assigned To: derick
Block user comment: N
Private report: N
New Comment:
This has been fixed in the meantime.
Previous Comments:
------------------------------------------------------------------------
[2015-08-24 13:31:18] ab@php.net
Yeah, that was seen actually in the build logs all the time. But not critical IMHO in first place as
the TZ offset can't grow that much. Still the warning should be probably fixed.
Thanks.
------------------------------------------------------------------------
[2015-08-24 12:12:44] andreas at fink dot org
Description:
------------
While compiling under OS X, the compiler warns us about a probably unwanted type conversion:
php-7.0.0RC1/ext/date/php_date.c:2196:6: warning: absolute value function 'abs' given an
argument of type
'long long' but has parameter of type 'int' which may cause truncation of
value [-Wabsolute-value]
abs(utc_offset / 60),
^
php-7.0.0RC1/ext/date/php_date.c:2196:6: note: use function 'llabs' instead
abs(utc_offset / 60),
^~~
llabs
given input is long long, we probably want output to be long long too or we might have a year 2038
problem (https://en.wikipedia.org/wiki/Year_2038_problem)
Test script:
---------------
./configure
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70340&edit=1