Skip to content

Commit

Permalink
Fix compilation in Clang C23 mode.
Browse files Browse the repository at this point in the history
In C23, `false` is now of type `bool`, not `int`. This turned a couple places where `false` was returned instead of `NULL` into errors.

The workaround in upb for Windows's broken NAN macro causes an error in Clang under C23, `cannot compile this static initializer yet`, I believe because `0.0 / 0.0` is not valid in constant-evaluation. This seems like it's probably a legitimate result of C23 standardizing constexpr, although it _could_ be a clang bug. In any case, refine the workaround a bit, to avoid this problem.

I've also reverted the kUpb_FltInfinity/kUpb_Infinity back to their former definitions, as INFINITY wasn't broken by the windows header, only NAN.

PiperOrigin-RevId: 683152452
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Oct 7, 2024
1 parent 0afe330 commit 8cc5f6b
Show file tree
Hide file tree
Showing 78 changed files with 433 additions and 1,385 deletions.
158 changes: 53 additions & 105 deletions php/ext/google/protobuf/wkt.inc

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions php/src/GPBMetadata/Google/Protobuf/Any.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 23 additions & 2 deletions php/src/GPBMetadata/Google/Protobuf/Api.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions php/src/GPBMetadata/Google/Protobuf/Duration.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions php/src/GPBMetadata/Google/Protobuf/FieldMask.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions php/src/GPBMetadata/Google/Protobuf/GPBEmpty.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8cc5f6b

Please sign in to comment.