New issue
Advanced search Search tips

Issue 772117 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug

Blocking:
issue 82385



Sign in to add a comment

clang-cl doesn't honor __pragma(warning(...))

Project Member Reported by davidben@chromium.org, Oct 5 2017

Issue description

At least it doesn't appear to? Windows headers like to scream loudly about use of dup2 over _dup2, etc. gtest-port.cc uses __pragma(warning(...)) to shut off the warning at that point.
https://cs.chromium.org/chromium/src/third_party/googletest/src/googletest/src/gtest-port.cc?rcl=7f8fefabedf2965980585be8c2bff97458f28e0b&l=926

Toying around with BoringSSL's standalone CMake build (which currently does not otherwise suppress the warning), it looks like the suppression isn't taking in clang-cl. Is this expected?
 
This is a valid feature request.

clang-cl in general only maps very few of Microsoft's warning numbers to clang-style warning flags, but it does do it for a handful of /wd flags (including 4996). This is currently done in a very on-the-nose way in the driver config (http://llvm-cs.pcc.me.uk/tools/clang/include/clang/Driver/CLCompatOptions.td#160). If we wanted to implement this, we'd have to pull this warning id -> clang flag mapping elsewhere, and then use it from both the driver and the pragma handler.
Blocking: 82385
Components: Build

Sign in to add a comment