Skip to content

Fix build warning on LibreSSL#21050

Merged
ndossche merged 1 commit intophp:PHP-8.4from
ndossche:libressl-build-fix-1
Apr 3, 2026
Merged

Fix build warning on LibreSSL#21050
ndossche merged 1 commit intophp:PHP-8.4from
ndossche:libressl-build-fix-1

Conversation

@ndossche
Copy link
Copy Markdown
Member

When trying to build on LibreSSL, I encounter the following build warning (this was observed on master, but applies to 8.4 too):

/work/php-src/ext/openssl/openssl.c: In function 'zif_openssl_x509_parse':
/work/php-src/ext/openssl/openssl.c:1101:22: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1101 |                 purp = X509_PURPOSE_get0(i);
      |                      ^
/work/php-src/ext/openssl/openssl.c:1110:23: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1110 |                 pname = useshortnames ? X509_PURPOSE_get0_sname(purp) : X509_PURPOSE_get0_name(purp);

When trying to build on LibreSSL, I encounter the following build
warning (this was observed on master, but applies to 8.4 too):
```
/work/php-src/ext/openssl/openssl.c: In function 'zif_openssl_x509_parse':
/work/php-src/ext/openssl/openssl.c:1101:22: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1101 |                 purp = X509_PURPOSE_get0(i);
      |                      ^
/work/php-src/ext/openssl/openssl.c:1110:23: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1110 |                 pname = useshortnames ? X509_PURPOSE_get0_sname(purp) : X509_PURPOSE_get0_name(purp);

```
Copy link
Copy Markdown
Member

@bukka bukka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I verified that it's X509_PURPOSE_get0_sname and X509_PURPOSE_get0_name both accept const on all supported version (1.1.1 included).

@ndossche ndossche merged commit 5216ca8 into php:PHP-8.4 Apr 3, 2026
10 checks passed
ndossche added a commit that referenced this pull request Apr 3, 2026
* PHP-8.4:
  Fix build warning on LibreSSL (#21050)
ndossche added a commit that referenced this pull request Apr 3, 2026
* PHP-8.5:
  Fix build warning on LibreSSL (#21050)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants