Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. _CRT_SECURE_NO_WARNINGS

_CRT_SECURE_NO_WARNINGS

Scheduled Pinned Locked Moved C / C++ / MFC
c++questiondelphihelp
4 Posts 4 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anthony Appleyard
    wrote on last edited by
    #1

    I am adapting for Visual C++ 2008 an old Borland C++ 4.5 program that contains many old-type string handling statements. The compiler tells me to "use _CRT_SECURE_NO_WARNINGS" to suppress warnings about strcpy and sprintf etc, but the online help gives no examples of its use. "#define _CRT_SECURE_NO_WARNINGS" has no effect. "_CRT_SECURE_NO_WARNINGS" (without quotes) alone on a line is treated as an undeclared variable. "#pragma _CRT_SECURE_NO_WARNINGS" causes a warning "unknown pragma". Please how do I put _CRT_SECURE_NO_WARNINGS in to suppress those warnings?

    CPalliniC M M 3 Replies Last reply
    0
    • A Anthony Appleyard

      I am adapting for Visual C++ 2008 an old Borland C++ 4.5 program that contains many old-type string handling statements. The compiler tells me to "use _CRT_SECURE_NO_WARNINGS" to suppress warnings about strcpy and sprintf etc, but the online help gives no examples of its use. "#define _CRT_SECURE_NO_WARNINGS" has no effect. "_CRT_SECURE_NO_WARNINGS" (without quotes) alone on a line is treated as an undeclared variable. "#pragma _CRT_SECURE_NO_WARNINGS" causes a warning "unknown pragma". Please how do I put _CRT_SECURE_NO_WARNINGS in to suppress those warnings?

      CPalliniC Offline
      CPalliniC Offline
      CPallini
      wrote on last edited by
      #2

      On my system (VS 2005), the following define (note: ends with DEPRECATE)

      #define _CRT_SECURE_NO_DEPRECATE

      works, while

      #define _CRT_SECURE_NO_WARNINGS

      not. :)

      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

      In testa che avete, signor di Ceprano?

      1 Reply Last reply
      0
      • A Anthony Appleyard

        I am adapting for Visual C++ 2008 an old Borland C++ 4.5 program that contains many old-type string handling statements. The compiler tells me to "use _CRT_SECURE_NO_WARNINGS" to suppress warnings about strcpy and sprintf etc, but the online help gives no examples of its use. "#define _CRT_SECURE_NO_WARNINGS" has no effect. "_CRT_SECURE_NO_WARNINGS" (without quotes) alone on a line is treated as an undeclared variable. "#pragma _CRT_SECURE_NO_WARNINGS" causes a warning "unknown pragma". Please how do I put _CRT_SECURE_NO_WARNINGS in to suppress those warnings?

        M Offline
        M Offline
        Maxwell Chen
        wrote on last edited by
        #3

        Anthony Appleyard wrote:

        Please how do I put _CRT_SECURE_NO_WARNINGS in to suppress those warnings?

        I put this in Project Properties --> C/C++ --> Preprocessor definitions.


        Maxwell Chen

        1 Reply Last reply
        0
        • A Anthony Appleyard

          I am adapting for Visual C++ 2008 an old Borland C++ 4.5 program that contains many old-type string handling statements. The compiler tells me to "use _CRT_SECURE_NO_WARNINGS" to suppress warnings about strcpy and sprintf etc, but the online help gives no examples of its use. "#define _CRT_SECURE_NO_WARNINGS" has no effect. "_CRT_SECURE_NO_WARNINGS" (without quotes) alone on a line is treated as an undeclared variable. "#pragma _CRT_SECURE_NO_WARNINGS" causes a warning "unknown pragma". Please how do I put _CRT_SECURE_NO_WARNINGS in to suppress those warnings?

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          Also, maybe take a look at this: Security Enhancements in the CRT[^] Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups