Skip to content

Conversation

devnexen
Copy link
Member

@devnexen devnexen commented Oct 8, 2025

No description provided.

@devnexen
Copy link
Member Author

devnexen commented Oct 8, 2025

@nono303 would you be able to try this branch ?

@nono303
Copy link
Contributor

nono303 commented Oct 9, 2025

@nono303 would you be able to try this branch ?

Hi @devnexen
applied https://patch-diff.githubusercontent.com/raw/php/php-src/pull/20110.patch and get less errors
see patched.log (and no_patch.log for diff)

@devnexen
Copy link
Member Author

devnexen commented Oct 9, 2025

Can you give another try please ?

@nono303
Copy link
Contributor

nono303 commented Oct 9, 2025

🎉 compile without errors on a9a7858
a9a7858.log

@devnexen devnexen marked this pull request as ready for review October 9, 2025 07:50
@devnexen devnexen linked an issue Oct 9, 2025 that may be closed by this pull request
@devnexen devnexen requested a review from nielsdos October 11, 2025 13:00
Comment on lines 1144 to 1149
const char *c_loc_name = const_cast<char *>(loc_name);
add_array_entry( c_loc_name , return_value , const_cast<char *>(LOC_LANG_TAG));
add_array_entry( c_loc_name , return_value , const_cast<char *>(LOC_SCRIPT_TAG));
add_array_entry( c_loc_name , return_value , const_cast<char *>(LOC_REGION_TAG));
add_array_entry( c_loc_name , return_value , const_cast<char *>(LOC_VARIANT_TAG));
add_array_entry( c_loc_name , return_value , const_cast<char *>(LOC_PRIVATE_TAG));
Copy link
Member

Choose a reason for hiding this comment

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

None of these casts are necessary I think

Copy link
Member Author

Choose a reason for hiding this comment

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

ext\intl\locale\locale_methods.cpp(1144): error C2664: 'int add_array_entry(const char *,zval *,char *)' : impossible de convertir l'argument 3 de 'const char [9]' en 'char *'
ext\intl\locale\locale_methods.cpp(1144): note: La conversion d'un litteral de chaine perd le qualificateur const (voir /Zc:strictStrings)
ext\intl\locale\locale_methods.cpp(1056): note: voir la declaration de 'add_array_entry'
ext\intl\locale\locale_methods.cpp(1144): note: lors de la tentative de mise en correspondance de la liste des arguments '(char *, zval *, const char [9])'
ext\intl\locale\locale_methods.cpp(1145): error C2664: 'int add_array_entry(const char *,zval *,char *)' : impossible de convertir l'argument 3 de 'const char [7]' en 'char *'
ext\intl\locale\locale_methods.cpp(1145): note: La conversion d'un litteral de chaine perd le qualificateur const (voir /Zc:strictStrings)
ext\intl\locale\locale_methods.cpp(1056): note: voir la declaration de 'add_array_entry'
ext\intl\locale\locale_methods.cpp(1145): note: lors de la tentative de mise en correspondance de la liste des arguments '(char *, zval *, const char [7])'
ext\intl\locale\locale_methods.cpp(1146): error C2664: 'int add_array_entry(const char *,zval *,char *)' : impossible de convertir l'argument 3 de 'const char [7]' en 'char *'
ext\intl\locale\locale_methods.cpp(1146): note: La conversion d'un litteral de chaine perd le qualificateur const (voir /Zc:strictStrings)
ext\intl\locale\locale_methods.cpp(1056): note: voir la declaration de 'add_array_entry'
ext\intl\locale\locale_methods.cpp(1146): note: lors de la tentative de mise en correspondance de la liste des arguments '(char *, zval *, const char [7])'
ext\intl\locale\locale_methods.cpp(1147): error C2664: 'int add_array_entry(const char *,zval *,char *)' : impossible de convertir l'argument 3 de 'const char [8]' en 'char *'
ext\intl\locale\locale_methods.cpp(1147): note: La conversion d'un litteral de chaine perd le qualificateur const (voir /Zc:strictStrings)
ext\intl\locale\locale_methods.cpp(1056): note: voir la declaration de 'add_array_entry'
ext\intl\locale\locale_methods.cpp(1147): note: lors de la tentative de mise en correspondance de la liste des arguments '(char *, zval *, const char [8])'
ext\intl\locale\locale_methods.cpp(1148): error C2664: 'int add_array_entry(const char *,zval *,char *)' : impossible de convertir l'argument 3 de 'const char [8]' en 'char *'
ext\intl\locale\locale_methods.cpp(1148): note: La conversion d'un litteral de chaine perd le qualificateur const (voir /Zc:strictStrings)
ext\intl\locale\locale_methods.cpp(1056): note: voir la declaration de 'add_array_entry'

Copy link
Member

Choose a reason for hiding this comment

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

You misunderstood. Keep the signature change of add_array_entry and then these casts should become unnecessary.

else {
/* Call ICU variant */
variant = get_icu_value_internal( loc_name , LOC_VARIANT_TAG , &result ,0);
variant = get_icu_value_internal( const_cast<char *>(loc_name) , LOC_VARIANT_TAG , &result ,0);
Copy link
Member

Choose a reason for hiding this comment

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

get_icu_value_internal takes a const char * as first argument, so this cast (and the ones below) are not necessary

Copy link
Member Author

Choose a reason for hiding this comment

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

what do you mean ? char* loc_name = NULL;

Copy link
Member

Choose a reason for hiding this comment

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

You can pass a char* to a const char* parameter and it works without a cast

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

This works, thanks

@devnexen
Copy link
Member Author

Hi @nono303 when you get the chance, can you confirm please ? thanks for your patience.

@nono303
Copy link
Contributor

nono303 commented Oct 13, 2025

Hi @nono303 when you get the chance, can you confirm please ? thanks for your patience.

Hi @devnexen, No problems ;)
✅ Applied 20110.patch ef59704 and still good for me

@devnexen devnexen closed this in f509420 Oct 13, 2025
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.

8.5 MSVC compilation error on ext/intl

3 participants