Bug: Unexported `extern "C"` block in `base.h` makes `WINRT_IMPL_*` declarations invisible to downstream modules
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- cpp
- Área
- build-system
Línea de trabajo
Start with the first extern "C" block in base.h and the references in Windows.Foundation.h from wait_for_completed and when_any; the issue identifies winrt.Windows.Foundation.ixx as a place where Clang reports the visibility error. Check how winrt_base exports declarations used by downstream modules, then build the module with Clang to confirm the reported failure is resolved.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Version
3.0.260818.1
Summary
In module builds, base.h is included in the module purview of winrt_base, and winrt.Windows.Foundation gets its base.h declarations via export import winrt_base;.
The first extern "C" block in base.h (declaring WINRT_IMPL_* functions) is not marked export. When Windows.Foundation.h calls WINRT_IMPL_CreateEventW, WINRT_IMPL_SetEvent, and WINRT_IMPL_WaitForSingleObject (in wait_for_completed and when_any), these functions are not visible to name lookup in winrt.Windows.Foundation.
extern "C" in a module purview only specifies C language linkage and global module ownership; it does not export the declarations. MSVC currently masks this bug by exposing unexported extern "C" declarations to importing modules, whereas Clang rejects winrt.Windows.Foundation.ixx with an undeclared/invisible identifier error.
Expected behavior
All declarations in winrt_base that are referenced by downstream namespace modules or generated component files (module.g.cpp) should either be explicitly exported (WINRT_EXPORT / export extern "C") or placed in a shared header included in the global module fragment.
Actual behavior
No response
Additional comments
A few related module-visibility mismatches stem from the same pattern in module builds:
1. Missing <intrin.h> in winrt.Windows.Foundation.ixx: <intrin.h> is only included in the global module fragments of winrt_base.ixx and winrt_numerics.ixx, but strings/base_coroutine_foundation.h (winrt::when_any) directly calls _InterlockedCompareExchangePointer inside winrt.Windows.Foundation.
2. Inconsistent linkage/export specifiers on namespace std specializations:
- strings/base_std_hash.h, strings/base_coroutine_threadpool.h, and strings/base_coroutine_foundation.h use WINRT_IMPL_STD_EXPORT namespace std (extern "C++" without export).
- strings/base_collections_map.h uses WINRT_EXPORT namespace std (export extern "C++").
- strings/base_string.h, strings/base_stringable_format.h, strings/base_stringable_format_1.h, and wrap_std_namespace in cppwinrt/code_writers.h declare std::hash and std::formatter specializations inside the module purview without extern "C++" or export, attaching std specializations to named modules.
- Lenguaje dominante
- C++
- Estrellas
- 1.9k
- Forks
- 288
- Merge medio
- 18 h 15 min
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/cppwinrt
-
Bug: Missing `<intrin.h>` in `winrt.Windows.Foundation.ixx` in module buildsPosiblemente ocupada @YexuanXiao la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
microsoft/cppwinrt#1646 · 7 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
microsoft/cppwinrt#1554 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Bug: Standard library headers included inside module purview of `winrt_numerics.ixx`Posiblemente ocupada @YexuanXiao la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
microsoft/cppwinrt#1647 · 17 comentarios ·
Los mantenedores suelen responder en 1 día
-
base_macros.h disables warnings without push/pop, leaking them into consumer translation unitsPosiblemente ocupada @DanielJump la tomó hace 64 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 20/100
Los mantenedores suelen responder en 1 día
-
Bug: headers cannot be compiled at high warning levels (MSVC /Wall, clang)Posiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
microsoft/cppwinrt#1620 · 3 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de microsoft/cppwinrt
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
-
[XLA] hlo/pass/README.md says passes implement Run; since the NVI change they implement RunImplAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NVIDIA-RTX/NRI#312 ·
Los mantenedores suelen responder en 1 día
-
permute_q_b_proj / permute_wv_proj accept scale factors from another devicePosiblemente ocupada @0z5a la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
deepseek-ai/FlashMLA#247 ·
Los mantenedores suelen responder en 1 día
-
Linux npm packaging leaves workspace files that block subsequent CI checkoutPosiblemente ocupada @Spockkk0225 la tomó hoy. Abiertoci
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
alibaba/neug#1195 · 1 comentario ·
Los mantenedores suelen responder en 1 día