Skip to content

THRIFT-6250: Silence the avoidable warnings in the MSVC CI build - #3853

Open
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:THRIFT-6250
Open

slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:THRIFT-6250

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

JIRA: THRIFT-6250
Client: build

The MSVC CI job prints about 400 warning lines per run. This takes out the families that have an in-tree fix; the ticket lists what each one is and what is deliberately left for later.

What the diff does not show:

  • The flex skeleton defines INT8_MIN and the other limit macros itself when it is not compiled as C99, which a C++ compile never is, and guards each with #ifndef. MSVC's stdint.h, included later, then redefined them. The %top block puts the header first, so the guards skip. winflexbison 2.5.24, which the image installs, is flex 2.6.4 and has the same guards.
  • LIBEVENT_ROOT is passed by build.bat, and CMake 3.27 or later warns three times that find_package ignores upper-case <PACKAGENAME>_ROOT variables until CMP0144 is NEW. The policy guard follows the CMP0074 one above it.
  • FPHSA_NAME_MISMATCHED is honoured since CMake 3.17 and ignored before, so it stays within the 3.16 minimum.
  • Not touched: the five LNK4098 lines come from libevent built /MT and need SET CL=/MD in build-libevent.bat, which rebuilds the Docker image, so that waits for THRIFT-6237: Shrink the MSVC Docker image #3844. protocol.tcc:995 is rewritten by THRIFT-6069: python: add fastbinary decode_binary_from_bytes #3594 and THRIFT-6069: python: use a flat fastbinary encode buffer #3596. AI_V4MAPPED is THRIFT-6249.

Verified: cmake -Wdev configure on macOS with CMake 4.4.3 → no dev warnings; thrift-compiler target builds and generates the tutorial; the generated thriftl.cc has #include <stdint.h> on line 2, ahead of the guards.

  • Did you create an Apache Jira ticket?
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit?
  • Did you do your best to avoid breaking changes?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

This change was created with AI assistance.

Client: build

- thriftl.ll: include <stdint.h> in a %top block. Flex defines INT8_MIN and
  the other limit macros itself when not compiled as C99, guarded by
  #ifndef, and MSVC's stdint.h then redefined them (9 x C4005 per run).
- lib/py/setup.py: pass -std=c++11 only to non-MSVC compilers; cl.exe
  warned D9002 and ignored it.
- CMakeLists.txt: set CMP0144 to NEW next to CMP0074. The MSVC build passes
  LIBEVENT_ROOT and CMake 3.27+ warned that find_package ignores it.
- FindClangTools.cmake: declare FPHSA_NAME_MISMATCHED; the module finds
  three tools under names that differ from its own by design.
- SecurityTest.cpp: cast away the shared_ptr that exists only to make the
  constructor throw (C4858).

Left for later, see the ticket: LNK4098 from libevent built /MT (image
change, after THRIFT-6237), C4244 in protocol.tcc (THRIFT-6069 rewrites the
file), and CS0114 in the generated netstd Xception.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@mergeable mergeable Bot added c++ Pull requests that update C++ code python compiler build and general CI cmake, automake and build system changes labels Sep 13, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 14, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build and general CI cmake, automake and build system changes c++ Pull requests that update C++ code compiler python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant