Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4182 closed Bugs (fixed)

macro redefinition warnings

Reported by: olafvdspek@… Owned by: John Maddock
Milestone: Boost 1.43.0 Component: config
Version: Boost 1.43.0 Severity: Problem
Keywords: Cc:

Description

#include <boost/algorithm/string.hpp>
#include <cstdint>

int main()
{
	return 0;
}

1>------ Build started: Project: Test, Configuration: Debug Win32 ------
1>  Test.cpp
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(116): warning C4005: 'INT8_C' : macro redefinition
1>          c:\vc\include\boost\cstdint.hpp(376) : see previous definition of 'INT8_C'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(117): warning C4005: 'INT16_C' : macro redefinition
1>          c:\vc\include\boost\cstdint.hpp(377) : see previous definition of 'INT16_C'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(118): warning C4005: 'INT32_C' : macro redefinition
1>          c:\vc\include\boost\cstdint.hpp(378) : see previous definition of 'INT32_C'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(120): warning C4005: 'UINT8_C' : macro redefinition
1>          c:\vc\include\boost\cstdint.hpp(384) : see previous definition of 'UINT8_C'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(121): warning C4005: 'UINT16_C' : macro redefinition
1>          c:\vc\include\boost\cstdint.hpp(386) : see previous definition of 'UINT16_C'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(122): warning C4005: 'UINT32_C' : macro redefinition
1>          c:\vc\include\boost\cstdint.hpp(387) : see previous definition of 'UINT32_C'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(165): warning C4005: 'INT64_C' : macro redefinition
1>          c:\vc\include\boost\cstdint.hpp(379) : see previous definition of 'INT64_C'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(166): warning C4005: 'UINT64_C' : macro redefinition
1>          c:\vc\include\boost\cstdint.hpp(388) : see previous definition of 'UINT64_C'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(167): warning C4005: 'INTMAX_C' : macro redefinition
1>          c:\vc\include\boost\cstdint.hpp(389) : see previous definition of 'INTMAX_C'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(168): warning C4005: 'UINTMAX_C' : macro redefinition
1>          c:\vc\include\boost\cstdint.hpp(390) : see previous definition of 'UINTMAX_C'
1>  Test.vcxproj -> C:\Users\Olaf\Documents\Visual Studio 2010\Projects\Test\Debug\Test.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Change History (7)

comment:1 by anonymous, 12 years ago

Component: Noneinteger
Owner: set to Daryle Walker
#include <boost/cstdint.hpp>
#include <cstdint>

comment:2 by Steven Watanabe, 12 years ago

Component: integerconfig
Owner: changed from Daryle Walker to John Maddock

Boost.Config needs to define BOOST_HAS_STDINT_H.

comment:3 by John Maddock, 12 years ago

Resolution: fixed
Status: newclosed

(In [62082]) Add support for <cstdint> in VC10. Fixes #4182.

comment:4 by anonymous, 12 years ago

There is another problem with this fix when intsafe.h from the windows sdk is included. Preventing BOOST_HAS_STDINT_H to get defined removes the warnings.

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 sdks\windows\v7.0a\include\intsafe.h(144) : see previous definition of 'INT8_MIN'
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 sdks\windows\v7.0a\include\intsafe.h(146) : see previous definition of 'INT16_MIN'
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 sdks\windows\v7.0a\include\intsafe.h(148) : see previous definition of 'INT32_MIN'
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 sdks\windows\v7.0a\include\intsafe.h(167) : see previous definition of 'INT8_MAX'
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 sdks\windows\v7.0a\include\intsafe.h(171) : see previous definition of 'INT16_MAX'
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 sdks\windows\v7.0a\include\intsafe.h(176) : see previous definition of 'INT32_MAX'
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 sdks\windows\v7.0a\include\intsafe.h(168) : see previous definition of 'UINT8_MAX'
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 sdks\windows\v7.0a\include\intsafe.h(173) : see previous definition of 'UINT16_MAX'
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 sdks\windows\v7.0a\include\intsafe.h(178) : see previous definition of 'UINT32_MAX'
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 sdks\windows\v7.0a\include\intsafe.h(152) : see previous definition of 'INT64_MIN'
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 sdks\windows\v7.0a\include\intsafe.h(184) : see previous definition of 'INT64_MAX'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdint.h(151): warning C4005: 'UINT64_MAX' : macro redefinition
1>          c:\program files (x86)\microsoft sdks\windows\v7.0a\include\intsafe.h(189) : see previous definition of 'UINT64_MAX'

comment:5 by anonymous, 12 years ago

This is nothing to do with us - the fact that two Microsoft headers conflict with each other is their issue not ours - sorry to be so blunt, but we should be able to use <stdint.h> without worrying what other headers may have been included.

John Maddock.

comment:6 by anonymous, 12 years ago

True. Do you have a snippet to reproduce this issue so it can be reported to MS?

comment:7 by John Maddock, 12 years ago

This:

#include <intsafe.h>
#include <stdint.h>
Last edited 12 years ago by John Maddock (previous) (diff)
Note: See TracTickets for help on using tickets.