[php-src] Issue #8881: address argument to atomic operation must be a pointer to non-const _Atomic type
| From: | ryandesign | Date: | Mon, 27 Jun 2022 17:00:43 +0000 |
| Subject: | [php-src] Issue #8881: address argument to atomic operation must be a pointer to non-const _Atomic type | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241820@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8881
Author: ryandesign
### Description
Hello! I'm the maintainer of php in MacPorts, and I noticed this build failure of php
8.2.0alpha2 and 8.2.0alpha1 on macOS 10.13 with Xcode 9.4.1 and its Apple clang 902.0.39.2:
```
Zend/zend_atomic.h:85:9: error: address argument to atomic operation must be a pointer to non-const
_Atomic type ('const _Atomic(bool) *' invalid)
return __c11_atomic_load(&obj->value, __ATOMIC_SEQ_CST);
^ ~~~~~~~~~~~
```
Here is a full failed build log from [macOS
10.13](https://build.macports.org/builders/ports-10.13_x86_64-builder/builds/155257/steps/install-port/logs/stdio).
I also verified the problem on macOS 10.13 with Xcode 10.1 and its Apple clang 1000.11.45.5.
It also fails similarly on [macOS
10.12](https://build.macports.org/builders/ports-10.12_x86_64-builder/builds/191235/steps/install-port/logs/stdio),
[OS X
10.11](https://build.macports.org/builders/ports-10.11_x86_64-builder/builds/186961/steps/install-port/logs/stdio),
and [OS X
10.10](https://build.macports.org/builders/ports-10.10_x86_64-builder/builds/187989/steps/install-port/logs/stdio).
The build succeeds on macOS 10.14 with Xcode 10.3 and its Apple clang 1001.0.46.4 and on newer
systems. Here is a full successful build log from [macOS
10.14](https://build.macports.org/builders/ports-10.14_x86_64-builder/builds/131801/steps/install-port/logs/stdio).
Curiously the build also succeeds on much older systems like [OS X
10.9](https://build.macports.org/builders/ports-10.9_x86_64-builder/builds/193206/steps/install-port/logs/stdio),
[OS X
10.8](https://build.macports.org/builders/ports-10.8_x86_64-builder/builds/95019/steps/install-port/logs/stdio),
and [Mac OS X
10.7](https://build.macports.org/builders/ports-10.7_x86_64-builder/builds/105173/steps/install-port/logs/stdio)
with their older versions of Xcode and clang.
I see "c11" in the error message but I don't see
-std=c11 being passed
to the compiler. Thinking this might be a situation where certain older compilers would support
whatever you're wanting to do if only you would ask the compiler to be in c11 mode, I tried
adding -std=c11 on macOS 10.13 with Xcode 10.1 and its Apple clang 1000.11.45.5, and I
also tried -std=gnu11, but neither of those changed the error.
php 8.1.7 and earlier don't have this problem.
### PHP Version
8.2.0alpha2
### Operating System
macOS 10.13.6