Opened 10 years ago
Closed 7 years ago
#7008 closed Bugs (fixed)
boost/serialization/detail/get_data.hpp leaks STD macro
Reported by: | Owned by: | Robert Ramey | |
---|---|---|---|
Milestone: | To Be Determined | Component: | serialization |
Version: | Boost 1.44.0 | Severity: | Problem |
Keywords: | Cc: | dave.lowell@… |
Description
The header boost/serialization/detail/get_data.hpp defines the macro STD for local use in the header. However, it does not un-define the macro at the end of the header, causing a commonly used name to be leaked as a macro for anything included after this header.
Attachments (1)
Change History (7)
comment:1 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 7 years ago
Cc: | added |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
The definition of STD in get_data.hpp is unconditional. What it's defined to depends on whether STLport is being used, but it's always defined to something.
However, the undef that's been added is conditional - STD is only undefined when STLport is being used. If it's not used, then it looks like the definition still leaks.
by , 7 years ago
Attachment: | get_data.hpp added |
---|
patched version of get_data.hpp with unconditional undef
follow-up: 4 comment:3 by , 7 years ago
Resolution: | → invalid |
---|---|
Status: | reopened → closed |
Sorry I'm not seeing this is the current code which looks like:
#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) #define STD _STLP_STD #else #define STD std #endif ... #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) #undef STD #endif
comment:4 by , 7 years ago
Replying to ramey:
Sorry I'm not seeing this is the current code which looks like:
#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) #define STD _STLP_STD #else #define STD std #endif ... #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) #undef STD #endif
What happens if neither SGI_STL_PORT nor _STLPORT_VERSION are defined?
The first block #defines STD to "std". The second block does not #undefine STD, hence the macro definition for STD leaks.
comment:5 by , 7 years ago
Resolution: | invalid |
---|---|
Status: | closed → reopened |
comment:6 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
OK - I don't know what I was thinking.
Fixed again now
OK - fixed on my machine - will eventually arrive at release