Bug #78545 [NEW]: Obsessive 'long' to 'double' warning while compiling on macOS
| From: | stas@php.net | Date: | Sun, 15 Sep 2019 21:22:57 +0000 |
| Subject: | Bug #78545 [NEW]: Obsessive 'long' to 'double' warning while compiling on macOS | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-222757@lists.php.net to get a copy of this message | ||
From: stas
Operating system: macOS
PHP version: master-Git-2019-09-15 (Git)
Package: Compile Warning
Bug Type: Bug
Bug description:Obsessive 'long' to 'double' warning while compiling on macOS
Description:
------------
I've noticed that recently I've been getting tons of warnings compiling
PHP, which are the same warning essentially:
/src/php-src/Zend/zend_API.c:333:21: warning: implicit conversion from
'long' to 'double' changes value from 9223372036854775807 to
9223372036854775808 [-Wimplicit-int-float-conversion]
if
(UNEXPECTED(!ZEND_DOUBLE_FITS_LONG(d))) {
^~~~~~~~~~~~~~~~~~~~~~~~
Zend/zend_operators.h:93:45: note: expanded from macro
'ZEND_DOUBLE_FITS_LONG'
# define ZEND_DOUBLE_FITS_LONG(d) (!((d) >= ZEND_LONG_MAX || (d) <
ZEND_LONG_MIN))
~~ ^~~~~~~~~~~~~
Zend/zend_long.h:34:24: note: expanded from macro 'ZEND_LONG_MAX'
# define ZEND_LONG_MAX INT64_MAX
^~~~~~~~~
/usr/include/stdint.h:163:22: note: expanded from macro 'INT64_MAX'
# define INT64_MAX (__INT64_C(9223372036854775807))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/stdint.h:145:24: note: expanded from macro '__INT64_C'
# define __INT64_C(c) c ## L
^~~~~~
<scratch space>:32:1: note: expanded from here
9223372036854775807L
^~~~~~~~~~~~~~~~~~~~
Zend/zend_portability.h:323:52: note: expanded from macro 'UNEXPECTED'
# define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
^~~~~~~~~
This seems to have something to do with how we do ZEND_DOUBLE_FITS_LONG
and it's extremely annoying and makes it hard to watch for other
warnings.
The compiler is standard one coming with macOS Mojave:
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
but other clang versions, like on Linux:
clang version 10.0.0 (trunk 371202)
produce the same.
--
Edit bug report at https://bugs.php.net/bug.php?id=78545&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=78545&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=78545&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=78545&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=78545&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=78545&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=78545&r=support
Expected behavior: https://bugs.php.net/fix.php?id=78545&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=78545&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=78545&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=78545&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=78545&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=78545&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=78545&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=78545&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78545&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=78545&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=78545&r=mysqlcfg