Opened 11 years ago

Closed 9 years ago

Last modified 9 years ago

#11009 closed defect (fixed)

VC9 deprecated functions when defs.h not included

Reported by: ScratchMonkey Owned by:
Priority: low Milestone:
Component: build Version: stable-latest
Keywords: deprecated Cc: vaclavslavik
Blocked By: Blocking:
Patch: yes

Description

When I "build solution" using the vc9 (Visual Studio 2008) solution, most of the libraries include defs.h and hence define _CRT_SECURE_NO_DEPRECATE. But a few such as wxregex and wxscintilla have sources that skip that header. The result is a spew of warnings about deprecated ANSI functions.

How about injecting this #define directly from the project via the bakefile?

I'm not sure which bakefile makes the most sense to do this in, but this experimental patch against trunk gets the symbol into all the desired project files.

Attachments (1)

common.bkl.diff download (610 bytes) - added by ScratchMonkey 11 years ago.
Patch against build/bakefiles/common.bkl

Download all attachments as: .zip

Change History (6)

Changed 11 years ago by ScratchMonkey

Patch against build/bakefiles/common.bkl

comment:1 Changed 11 years ago by vadz

  • Milestone set to 2.9.1
  • Status changed from new to confirmed

Thanks, I think this should indeed be applied, does anyone see anything against it?

comment:2 Changed 11 years ago by vadz

  • Cc vaclavslavik added

One small problem with this patch is that it also adds this flag to rc and midl flags and it really doesn't make much sense there. Not a huge problem, arguably, but still weird. Vaclav, is there some way to only add the flag for cl itself?

Thanks!

comment:3 Changed 10 years ago by vadz

  • Milestone 2.9.1 deleted
  • Priority changed from normal to low

This is not critical for 2.9.1. I still wonder about what would be the best way to do this but I guess we could add /D_CRT_SECURE_NO_DEPRECATE directly to cflags instead of using <define>.

comment:4 Changed 9 years ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [70182]) Disable VC8+ deprecation warnings for standard functions at bakefile level.

We already define the symbols needed to disable the warnings in wx/defs.h but
this isn't enough for third party code not including it, so define them in the
project settings directly.

Closes #11009.

comment:5 Changed 9 years ago by VZ

(In [70532]) Avoid CRT deprecation warnings for MSVC build using makefiles too.

Define _CRT_SECURE_NO_DEPRECATE, _CRT_NON_CONFORMING_SWPRINTFS and
_SCL_SECURE_NO_WARNINGS when using makefiles to build the library too for
consistency with the project files.

These defines are only needed for VC8 and later but should do no harm for the
previous versions.

See #11009.

Note: See TracTickets for help on using tickets.