[flang-commits] [flang] [flang] Use std::uintptr_t instead of unsigned long for better cross-platform stability (PR #183913)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Sun Mar 1 06:53:49 PST 2026


================
@@ -253,31 +253,17 @@ constexpr TypeBuilderFunc getModel<void (*)(int)>() {
 }
 template <>
 constexpr TypeBuilderFunc
-getModel<void *(*)(void *, const void *, unsigned long)>() {
+getModel<void *(*)(void *, const void *, std::uintptr_t)>() {
----------------
eugeneepshteyn wrote:

The routines are not redundant, if they handle separate types. For example, MSVC `__int64` is a distinct type from other 64 bit types (or at least was a distinct type the last time I worked with Windows). The end result may be the same as for any other 64 bit type, but it's still a distinct type that requires separate specialization.

Truly redundant specializations will cause compilation errors.

Remember that your fix still needs to work with the other compilers and operating systems.

https://github.com/llvm/llvm-project/pull/183913


More information about the flang-commits mailing list