Skip to content

Avoid duplicate signed char generic association with MSVC - #535

Open
crazywhalecc wants to merge 2 commits into
ngtcp2:mainfrom
crazywhalecc:fix-msvc-generic-char
Open

Avoid duplicate signed char generic association with MSVC#535
crazywhalecc wants to merge 2 commits into
ngtcp2:mainfrom
crazywhalecc:fix-msvc-generic-char

Conversation

@crazywhalecc

Copy link
Copy Markdown

What does this PR do?

MSVC rejects the nghttp3_max and nghttp3_min _Generic association lists because both signed char and char are present and are treated as compatible types, which causes C7700 errors when building nghttp3 with Visual Studio 2022.

This change omits the signed char generic association only for MSVC, while preserving the existing behavior for other compilers. The actual nghttp3 call sites use integer, size_t, and uint64_t values, so this avoids the MSVC compile failure without changing the non-MSVC path.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces conditional compilation macros to omit the signed char association from _Generic selection lists in nghttp3_max and nghttp3_min when compiling with MSVC. The review feedback correctly identifies that newer versions of MSVC (VS 2022 17.14+) and Clang conformantly treat signed char as a distinct type, meaning unconditional omission will lead to compilation failures. It is recommended to update the preprocessor checks to only omit the association on older MSVC versions when not compiling with Clang.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread lib/nghttp3_macro.h Outdated
Comment thread lib/nghttp3_macro.h Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant