php / php/php-src

address argument to atomic operation must be a pointer to non-const _Atomic type

Offen
#8,881 10 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bug Category: Engine Status: Needs Triage
Vorherrschende Sprache
C
Sterne
40.4k
Forks
8.2k
Ø Merge
2 T. 15 Std.
Gemergte PRs (30 T.)
103

Beschreibung

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.

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, OS X 10.11, and OS X 10.10.

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.

Curiously the build also succeeds on much older systems like OS X 10.9, OS X 10.8, and Mac OS X 10.7 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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie mit Zend/zend_atomic.h und reproduzieren Sie den PHP 8.2-Build auf den betroffenen macOS- und Apple-clang-Versionen, die im Bericht aufgeführt sind. Vergleichen Sie das Verhalten der atomaren Operationen über die gemeldeten Compilerversionen hinweg; die Arbeit ist abgeschlossen, wenn PHP auf den betroffenen Systemen erfolgreich erstellt wird, ohne Regressionen bei den neueren und älteren Konfigurationen zu verursachen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
c, php
Bereich
build-system, operating-systems
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.