Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC 2019 emits 1000s of deprecation warnings #59730

Closed
eseidel opened this issue Jun 18, 2020 · 7 comments
Closed

MSVC 2019 emits 1000s of deprecation warnings #59730

eseidel opened this issue Jun 18, 2020 · 7 comments

Comments

@eseidel
Copy link
Contributor

eseidel commented Jun 18, 2020

According to stack overflow,
-D_CRT_NONSTDC_NO_DEPRECATE is the easy solution.
https://stackoverflow.com/questions/7582394/strdup-or-strdup

Objection @stuartmorgan @clarkezone?

@eseidel
Copy link
Contributor Author

eseidel commented Jun 18, 2020

These are the defines //base:base has from Chromium:
gn desc .\out\Default\ //base:base defines

defines
  USE_AURA=1
  CR_CLANG_REVISION="n356902-4e813bbd-1"
  _HAS_NODISCARD
  COMPONENT_BUILD
  _LIBCPP_ABI_UNSTABLE
  _LIBCPP_ENABLE_NODISCARD
  _LIBCPP_NO_AUTO_LINK
  __STD_C
  _CRT_RAND_S
  _CRT_SECURE_NO_DEPRECATE
  _SCL_SECURE_NO_DEPRECATE
  _ATL_NO_OPENGL
  _WINDOWS
  CERT_CHAIN_PARA_HAS_EXTRA_FIELDS
  PSAPI_VERSION=2
  WIN32
  _SECURE_ATL
  WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP
  WIN32_LEAN_AND_MEAN
  NOMINMAX
  _UNICODE
  UNICODE
  NTDDI_VERSION=NTDDI_WIN10_RS2
  _WIN32_WINNT=0x0A00
  WINVER=0x0A00
  _DEBUG
  DYNAMIC_ANNOTATIONS_ENABLED=1
  BASE_IMPLEMENTATION
  BORINGSSL_SHARED_LIBRARY

Still not sure how these are silenced from Chromium.

@eseidel
Copy link
Contributor Author

eseidel commented Jun 18, 2020

Ah looks like through the warning flags? I believe /wd4996 should do the trick?

/wd4091
  /wd4127
  /wd4251
  /wd4275
  /wd4312
  /wd4324
  /wd4351
  /wd4355
  /wd4503
  /wd4589
  /wd4611
  /wd4100
  /wd4121
  /wd4244
  /wd4505
  /wd4510
  /wd4512
  /wd4610
  /wd4838
  /wd4995
  /wd4996
  /wd4456
  /wd4457
  /wd4458
  /wd4459
  /wd4200
  /wd4201
  /wd4204
  /wd4221
  /wd4245
  /wd4267
  /wd4305
  /wd4389
  /wd4702
  /wd4701
  /wd4703
  /wd4661
  /wd4706
  /wd4715

@stuartmorgan
Copy link
Contributor

This is a subset of #59199. I was going to revisit this once Dart's instances are fixed (which is in progress already) to see if any are left after that.

We should fix them, rather than suppress them, since it should be very few at that point.

@eseidel
Copy link
Contributor Author

eseidel commented Jun 18, 2020

I see warnings about strdup vs. _strdup, and as far as I can tell Chromium still use "strdup", so they must either be using a conventionalized macro, or suppressing the warning?

@eseidel
Copy link
Contributor Author

eseidel commented Jun 18, 2020

I'm happy to close this though. Thanks for the response!

@eseidel eseidel closed this as completed Jun 18, 2020
@stuartmorgan
Copy link
Contributor

stuartmorgan commented Jun 18, 2020

I see warnings about strdup vs. _strdup

From Dart, yes.

and as far as I can tell Chromium still use "strdup", so they must either be using a conventionalized macro, or suppressing the warning?

I don't know if Chromium is suppressing the warning, but my Dart CL to suppress that deprecation warning was declined in favor of switching Windows to _strdup (via a wrapper), which there is a PR for (in fact, two, accidentally, because both I and someone on the Dart side ended up working on it at the same time without realizing it.)

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants