Search

Including stdint after intsafe generates warnings by Olaf vander Spek

Closed
as Fixed Help for as Fixed

10
0
Sign in
to vote
Type: Bug
ID: 621653
Opened: 11/13/2010 9:02:13 AM
Access Restriction: Public
3
Workaround(s)
12
User(s) can reproduce this bug
Including stdint after intsafe generates warnings
Details (expand)

Visual Studio/Silverlight/Tooling version

Visual Studio 2010

What category (if any) best represents this feedback?

Compatibility

Steps to reproduce

#include <intsafe.h>
#include <stdint.h>

Product Language

English

Operating System

Windows 7

Operating System Language

English

Actual results

1>------ Build started: Project: IntSafe Warnings, Configuration: Debug Win32 ------
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(72): warning C4005: 'INT8_MIN' : macro redefinition
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(73): warning C4005: 'INT16_MIN' : macro redefinition
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(74): warning C4005: 'INT32_MIN' : macro redefinition
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(76): warning C4005: 'INT8_MAX' : macro redefinition
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(77): warning C4005: 'INT16_MAX' : macro redefinition
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(78): warning C4005: 'INT32_MAX' : macro redefinition
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(79): warning C4005: 'UINT8_MAX' : macro redefinition
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(80): warning C4005: 'UINT16_MAX' : macro redefinition
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(81): warning C4005: 'UINT32_MAX' : macro redefinition
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(149): warning C4005: 'INT64_MIN' : macro redefinition
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(150): warning C4005: 'INT64_MAX' : macro redefinition
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(151): warning C4005: 'UINT64_MAX' : macro redefinition
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Expected results

No warnings
File Attachments
0 attachments
Sign in to post a comment.
Posted by Andrew Bushnell [Autodesk] on 7/7/2011 at 12:49 PM
When you say "Next major release" do you mean a service pack on top of VC2010 or it would be more than likely a version past 2010 (say 2012).
Posted by Microsoft on 2/8/2011 at 8:26 AM
Hello,

Thanks for the report. This issue has been fixed in the VC++ header files for the next major release of Visual Studio.

Pat Brenner
Visual C++ Libraries Development
Posted by Microsoft on 12/28/2010 at 11:52 AM
Thanks for reporting this. We apparently have a definition of these both in the VC headers and in the Windows SDK. We'll discuss where the appropriate place to fix is and will look into fixing it in a future release.

Alex Thaman
Senior Test Lead
Visual C++ Team
Posted by Microsoft on 11/14/2010 at 6:32 PM
Thank you for reporting the issue.
We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution.These specialized experts will follow-up with your issue.
Posted by Microsoft on 11/13/2010 at 9:22 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Maxime Chamley on 12/30/2010 at 7:27 AM
It also happen in the other order, if you include intsafe after stdint.

Quick and dirty, but no other choice for now as I know if you considere warning as error in your project.
On your top headers, include directly this both header files and disable the warning C4005 the time of the declaration.


#ifdef _MSC_VER // This check can be removed if you only build for Windows
#pragma warning (push)
#pragma warning (disable : 4005)
#include <intsafe.h>
#include <stdint.h>
#pragma warning (push)
#pragma warning (default : 4005)
#endif
Posted by Olaf vander Spek on 1/14/2011 at 4:25 AM
That work around is wrong. You should do push, disable, pop, not push, disable, push default.
Posted by John Crockett on 12/5/2011 at 2:06 AM
in stdafx.h, insert

#define _INTSAFE_H_INCLUDED_
#include <stdint.h>

as the first include