Modify

Ticket #4182 (closed Bugs: fixed)

Opened 4 years ago

Last modified 3 years ago

macro redefinition warnings

Reported by: olafvdspek@… Owned by: johnmaddock
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 ==========

Attachments

Change History

comment:1 Changed 4 years ago by anonymous

  • Owner set to dlwalker
  • Component changed from None to integer
#include <boost/cstdint.hpp>
#include <cstdint>

comment:2 Changed 4 years ago by steven_watanabe

  • Owner changed from dlwalker to johnmaddock
  • Component changed from integer to config

Boost.Config needs to define BOOST_HAS_STDINT_H.

comment:3 Changed 4 years ago by johnmaddock

  • Status changed from new to closed
  • Resolution set to fixed

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

comment:4 Changed 3 years ago by anonymous

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 Changed 3 years ago by anonymous

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 Changed 3 years ago by anonymous

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

comment:7 Changed 3 years ago by johnmaddock

This:

#include <intsafe.h>
#include <stdint.h>
Last edited 3 years ago by johnmaddock (previous) (diff)
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.