Nmap Development mailing list archives

Re: Visual Studios Compile question


From: kx <kxmail () gmail com>
Date: Fri, 23 Mar 2007 23:06:03 +0100

I agree. #define _CRT_SECURE_NO_DEPRECATE 1 is definitely the way to
go, and when I removed those other two lines, I had no other warnings.
But  #define _CRT_SECURE_NO_WARNINGS 1 is creating a new warning.

I just installed VS 2005 Express fresh today and SP1 for VS 2005 and I
have the Microsoft Platform SDK for Windows Server 2003 R2 (new XP
laptop).

I just hate using a pragma to turn off all deprecation warnings, and
while _CRT_SECURE_NO_WARNINGS is the new way to turn off the warnings:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=101187

... it seems broke.

I am wondering if you had the warnings because it wasn't SP1?

If anyone has VS Express with SP1, it would be helpful to know if you
get the CRT warnings by removing the pragma and
_CRT_SECURE_NO_WARNINGS 1

Cheers,
  kx

On 3/23/07, Kris Katterjohn <katterjohn () gmail com> wrote:
kx wrote:
In nbase_winconfig.h:

/* Without these, Windows will give us all sorts of crap about using functions
   like strcpy() even if they are done safely */
#define _CRT_SECURE_NO_DEPRECATE 1
#define _CRT_SECURE_NO_WARNINGS 1
#pragma warning(disable: 4996)


#define _CRT_SECURE_NO_WARNINGS 1

 causes this warning:

...\nbase\nbase_winconfig.h(148) : warning C4005:
'_CRT_SECURE_NO_WARNINGS' : macro redefinition
c:\program files\microsoft visual studio 8\vc\include\crtdefs.h(332) :
see previous definition of '_CRT_SECURE_NO_WARNINGS'

Also, with _CRT_SECURE_NO_DEPRECATE, you shouldn't get warning C4996

I suggest removing

#define _CRT_SECURE_NO_WARNINGS 1
#pragma warning(disable: 4996)

As they don't seem to affect anything with _CRT_SECURE_NO_DEPRECATE defined.

Cheers,
  kx

P.S.  Sorry I have been away so long. Moved to a different continent.
If anyone has any Windows testing/debugging areas they would like me
to focus on, please let me know.


Hey, kx!

I added those on Feb 1 (SVN r4451) because _CRT_SECURE_NO_DEPRECATE just
wasn't cutting it with MS VC++ 2005 Express.

Warnings about supposedly "insecure" functions (like strncpy!) were
flooding the little compiler/debug message console (or whatever that
little things is called)

Any ideas? :)

(I had a Windows XP machine that had the VC++ installed that I was using
to test Nmap with.  I've been going through a painfully slow move, so I
don't have that Windows machine setup to test any changes with)


Thanks,
Kris Katterjohn




_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: