Skip to content

Fix GH-17687: initializer-string for array of ... warnings #18603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: PHP-8.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Zend/zend_portability.h
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,12 @@ extern "C++" {
# define ZEND_INDIRECT_RETURN
#endif

#if __has_attribute(nonstring)
# define ZEND_NONSTRING __attribute__((nonstring))
#else
# define ZEND_NONSTRING
#endif

#define __ZEND_DO_PRAGMA(x) _Pragma(#x)
#define _ZEND_DO_PRAGMA(x) __ZEND_DO_PRAGMA(x)
#if defined(__clang__)
Expand Down
2 changes: 1 addition & 1 deletion ext/pdo/pdo_sqlstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "php_pdo_driver.h"

struct pdo_sqlstate_info {
const char state[5];
const char state[5] ZEND_NONSTRING;
const char *desc;
};

Expand Down
2 changes: 1 addition & 1 deletion ext/standard/crypt_sha256.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static const char sha256_rounds_prefix[] = "rounds=";
#define ROUNDS_MAX 999999999

/* Table with characters for base64 transformation. */
static const char b64t[64] =
static const char b64t[64] ZEND_NONSTRING =
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int buflen)
Expand Down
2 changes: 1 addition & 1 deletion ext/standard/crypt_sha512.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ static const char sha512_rounds_prefix[] = "rounds=";
#define ROUNDS_MAX 999999999

/* Table with characters for base64 transformation. */
static const char b64t[64] =
static const char b64t[64] ZEND_NONSTRING =
"./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";


Expand Down
Loading