Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #70772

MSVC deprecation (was Re: Hidden agendas on Usenet)

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject MSVC deprecation (was Re: Hidden agendas on Usenet)
Date 2015-09-16 23:31 -0700
Organization None to speak of
Message-ID <ln8u85h7zx.fsf_-_@kst-u.example.com> (permalink)
References (10 earlier) <mtcn6j$l1v$1@speranza.aioe.org> <55F9E4A8.9070201@verizon.net> <mtcovc$ouu$1@speranza.aioe.org> <lnoah2gg47.fsf@kst-u.example.com> <26fkvahlbfiico98l1c49mvpop222o5v35@4ax.com>

Show all headers | View raw


Geoff <geoff@invalid.invalid> writes:
> On Wed, 16 Sep 2015 15:21:28 -0700, Keith Thompson <kst-u@mib.org>
> wrote:
>
>>The statement jacob made that you responded to was:
>>
>>    All functions of C89 are available under MSVC as always. You will
>>    get a warning (that can be avoided by adding a #define) if you use
>>    them, that is all.
>>
>>He was, as far as I can tell, correct.  (Apparently there are
>>some configurations in which you'll get a fatal error.  I do not
>>believe such configurations are enabled by default.  I'm waiting
>>for confirmation on that point in another thread.)
>>
>
> Not knowing which thread contains your query, I'll answer it here.
>
> Jacob is correct. The MSVC system emits warnings about the Standard
> Library functions they consider unsafe or deprecated. The compiler
> emits warnings:
>
> "warning C4996: 'strncpy': This function or variable may be unsafe.
> Consider using strncpy_s instead. To disable deprecation, use
> _CRT_SECURE_NO_WARNINGS. See online help for details."
>
> One can suppress these warnings by:
>
> 1) 
> #define _CRT_SECURE_NO_WARNINGS 
>
> 2)
> #if _MSC_VER > 1500 // VS 2010 or later
> #pragma warning (disable:4996)
> #endif
>
> 3)
> defining _CRT_SECURE_NO_WARNINGS in the project settings in the IDE.
>
> My personal preference is for 2 or 1 depending on how many source
> files are involved.
>
> The compiler can be configured to treat warnings as errors by
> asserting /WX on the command line. In this case the tool emits a
> single error message:
>
> "error C2220: warning treated as error - no 'object' file generated" 
>
> and C4996 warnings for each line in the source where such warnings are
> deemed appropriate.

Thanks for the information.  What version of MSVC are you using?

In the original thread (subject "Compiling C project for Windows and Mac
OS X (GCC for Linux)"), Richard Damon wrote:

    I believe Microsoft themselves changed the default recently to turn
    this on as a fatal error.

Your observation could be consistent with that *if* you're using a
non-current version.  But then it seems odd that the MSDN documentation
for Visual Studio 2015:
    https://msdn.microsoft.com/en-us/library/kk6xf663.aspx
doesn't warn against strcpy more strongly than it does.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 06:18 +0200
  Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Ian Collins <ian-news@hotmail.com> - 2015-09-16 17:06 +1200
    Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Noob <root@127.0.0.1> - 2015-09-16 08:00 +0200
      Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-16 09:00 +0200
        Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 02:03 -0700
          Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-16 11:20 +0200
            Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 13:08 +0200
              Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-16 13:26 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 17:47 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 09:37 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 15:41 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-17 07:06 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 16:22 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-16 23:13 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 15:35 +0200
              Re: Compiling C project for Windows and Mac OS X (GCC for Linux) jacobnavia <jacob@jacob.remcomp.fr> - 2015-09-16 18:12 +0200
            Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Noob <root@127.0.0.1> - 2015-09-16 13:18 +0200
              Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 08:47 -0700
                Re: Quoting Noob <root@127.0.0.1> - 2015-09-16 20:30 +0200
                Re: Quoting Keith Thompson <kst-u@mib.org> - 2015-09-16 11:41 -0700
                Re: Quoting Noob <root@127.0.0.1> - 2015-09-16 20:53 +0200
                Re: Quoting Keith Thompson <kst-u@mib.org> - 2015-09-16 12:19 -0700
                Re: Quoting Noob <root@127.0.0.1> - 2015-09-16 21:49 +0200
                Re: Quoting Keith Thompson <kst-u@mib.org> - 2015-09-16 13:24 -0700
            Re: Compiling C project for Windows and Mac OS X (GCC for Linux) jacobnavia <jacob@jacob.remcomp.fr> - 2015-09-16 18:14 +0200
              Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 18:22 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) jacobnavia <jacob@jacob.remcomp.fr> - 2015-09-16 18:29 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 18:31 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) James Kuyper <jameskuyper@verizon.net> - 2015-09-16 12:48 -0400
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 18:56 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) James Kuyper <jameskuyper@verizon.net> - 2015-09-16 13:09 -0400
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 23:41 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) James Kuyper <jameskuyper@verizon.net> - 2015-09-16 18:05 -0400
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Martin Shobe <martin.shobe@yahoo.com> - 2015-09-16 12:13 -0500
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 10:13 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) fir <profesor.fir@gmail.com> - 2015-09-16 14:01 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 10:02 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) fir <profesor.fir@gmail.com> - 2015-09-16 13:53 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) fir <profesor.fir@gmail.com> - 2015-09-16 14:10 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 10:33 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 19:40 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Martin Shobe <martin.shobe@yahoo.com> - 2015-09-16 12:50 -0500
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 19:55 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) James Kuyper <jameskuyper@verizon.net> - 2015-09-16 13:57 -0400
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 11:02 -0700
                Re: Hidden agendas on Usenet Noob <root@127.0.0.1> - 2015-09-16 20:50 +0200
                Re: Hidden agendas on Usenet Keith Thompson <kst-u@mib.org> - 2015-09-16 12:20 -0700
                Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-16 23:33 +0200
                Re: Hidden agendas on Usenet James Kuyper <jameskuyper@verizon.net> - 2015-09-16 17:52 -0400
                Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 00:03 +0200
                Re: Hidden agendas on Usenet Keith Thompson <kst-u@mib.org> - 2015-09-16 15:21 -0700
                Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 00:30 +0200
                Re: Hidden agendas on Usenet Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 00:26 +0100
                Re: Hidden agendas on Usenet Geoff <geoff@invalid.invalid> - 2015-09-16 21:24 -0700
                Re: Hidden agendas on Usenet Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 05:48 +0100
                Re: Hidden agendas on Usenet Geoff <geoff@invalid.invalid> - 2015-09-17 07:16 -0700
                Re: Hidden agendas on Usenet Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 17:00 +0100
                Re: Hidden agendas on Usenet Keith Thompson <kst-u@mib.org> - 2015-09-17 11:23 -0700
                MSVC deprecation (was Re: Hidden agendas on Usenet) Keith Thompson <kst-u@mib.org> - 2015-09-16 23:31 -0700
                Re: MSVC deprecation (was Re: Hidden agendas on Usenet) Geoff <geoff@invalid.invalid> - 2015-09-17 07:33 -0700
                Re: Hidden agendas on Usenet David Brown <david.brown@hesbynett.no> - 2015-09-17 11:46 +0200
                Re: Hidden agendas on Usenet Ian Collins <ian-news@hotmail.com> - 2015-09-17 22:26 +1200
                Re: Hidden agendas on Usenet gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-17 11:17 +0000
                Re: Hidden agendas on Usenet David Brown <david.brown@hesbynett.no> - 2015-09-17 13:33 +0200
                Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 13:56 +0200
                Re: Hidden agendas on Usenet David Brown <david.brown@hesbynett.no> - 2015-09-17 14:20 +0200
                Re: Hidden agendas on Usenet Bartc <bc@freeuk.com> - 2015-09-17 13:28 +0100
                Re: Hidden agendas on Usenet David Brown <david.brown@hesbynett.no> - 2015-09-17 15:18 +0200
                Re: Hidden agendas on Usenet gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-17 13:34 +0000
                Re: Hidden agendas on Usenet gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-17 12:29 +0000
                Re: Hidden agendas on Usenet Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-17 05:34 -0700
                Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 14:48 +0200
                Re: Hidden agendas on Usenet James Kuyper <jameskuyper@verizon.net> - 2015-09-17 08:52 -0400
                Re: Hidden agendas on Usenet James Kuyper <jameskuyper@verizon.net> - 2015-09-17 08:50 -0400
                Re: Hidden agendas on Usenet gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-17 12:57 +0000
                Re: Hidden agendas on Usenet Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 13:52 +0100
                Re: Hidden agendas on Usenet fir <profesor.fir@gmail.com> - 2015-09-17 07:13 -0700
                Re: Hidden agendas on Usenet fir <profesor.fir@gmail.com> - 2015-09-17 07:42 -0700
                Re: Hidden agendas on Usenet fir <profesor.fir@gmail.com> - 2015-09-17 07:55 -0700
                Re: Hidden agendas on Usenet fir <profesor.fir@gmail.com> - 2015-09-18 05:51 -0700
                Re: Hidden agendas on Usenet James Kuyper <jameskuyper@verizon.net> - 2015-09-16 16:27 -0400
                Re: Hidden agendas on Usenet David Brown <david.brown@hesbynett.no> - 2015-09-16 23:35 +0200
                Re: Hidden agendas on Usenet Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 00:36 +0100
                Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 08:09 +0200
                Re: Hidden agendas on Usenet Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 07:59 +0100
                Re: Hidden agendas on Usenet Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-17 01:13 -0700
                Re: Hidden agendas on Usenet "Morten W. Petersen" <morphex@gmail.com> - 2015-09-17 13:08 +0200
              Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-16 23:22 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Richard Damon <Richard@Damon-Family.org> - 2015-09-17 08:57 -0400
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-17 15:28 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) James Kuyper <jameskuyper@verizon.net> - 2015-09-17 09:45 -0400
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Richard Damon <Richard@Damon-Family.org> - 2015-09-17 22:56 -0400
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-18 10:19 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Robert Wessel <robertwessel2@yahoo.com> - 2015-09-17 23:01 -0500
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-18 10:20 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Richard Heathfield <rjh@cpax.org.uk> - 2015-09-18 09:23 +0100
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) David Brown <david.brown@hesbynett.no> - 2015-09-18 14:08 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-18 08:48 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Lowell Gilbert <lgusenet@be-well.ilk.org> - 2015-09-18 16:44 -0400
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) James Kuyper <jameskuyper@verizon.net> - 2015-09-18 17:33 -0400
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Lowell Gilbert <lgusenet@be-well.ilk.org> - 2015-09-19 21:12 -0400
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) raltbos@xs4all.nl (Richard Bos) - 2015-09-21 09:10 +0000
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-21 09:16 +0000
          Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 08:34 -0700
            Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 09:33 -0700
              Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 10:43 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 12:29 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 13:10 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 13:42 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 14:04 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-16 14:34 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 15:01 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Richard Damon <Richard@Damon-Family.org> - 2015-09-16 22:26 -0400
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) jacobnavia <jacob@jacob.remcomp.fr> - 2015-09-17 13:46 +0200
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 12:48 +0100
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Philip Lantz <prl@canterey.us> - 2015-09-19 12:40 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) raltbos@xs4all.nl (Richard Bos) - 2015-09-21 09:14 +0000
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Malcolm McLean <malcolm.mclean5@btinternet.com> - 2015-09-21 06:13 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-09-21 17:39 +0100
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) raltbos@xs4all.nl (Richard Bos) - 2015-10-02 13:21 +0000
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-10-02 13:25 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) raltbos@xs4all.nl (Richard Bos) - 2015-10-04 13:51 +0000
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-10-04 15:45 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Geoff <geoff@invalid.invalid> - 2015-09-16 21:39 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Richard Heathfield <rjh@cpax.org.uk> - 2015-09-17 00:42 +0100
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Kelsey Bjarnason <kbjarnason@gmail.com> - 2015-09-24 07:34 -0700
                Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Robert Wessel <robertwessel2@yahoo.com> - 2015-09-16 23:55 -0500
              Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Robert Wessel <robertwessel2@yahoo.com> - 2015-09-16 13:03 -0500
      Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Ian Collins <ian-news@hotmail.com> - 2015-09-16 19:31 +1200
        Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Noob <root@127.0.0.1> - 2015-09-16 11:06 +0200
          Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Ian Collins <ian-news@hotmail.com> - 2015-09-16 21:17 +1200
            Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Noob <root@127.0.0.1> - 2015-09-16 11:56 +0200
              Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Keith Thompson <kst-u@mib.org> - 2015-09-16 08:59 -0700
                Re: "gcc" on OS X Noob <root@127.0.0.1> - 2015-09-16 21:43 +0200
                Re: "gcc" on OS X Keith Thompson <kst-u@mib.org> - 2015-09-16 13:20 -0700
              Re: Compiling C project for Windows and Mac OS X (GCC for Linux) Ian Collins <ian-news@hotmail.com> - 2015-09-17 08:25 +1200
              Re: Compiling C project for Windows and Mac OS X (GCC for Linux) gazelle@shell.xmission.com (Kenny McCormack) - 2015-09-17 11:21 +0000
                Re: gcc not a symlink on Mac OS X Noob <root@127.0.0.1> - 2015-09-17 17:06 +0200

csiph-web