Skip to content

Conversation

@rdoeffinger
Copy link
Contributor

They increase memory consumption and make exploits
easier and are completely unnecessary.
Avoid them by either avoiding the pointer indirection
completely by using char arrays for strings instead
of char pointers, convert "static" pointer variables
to simple local variables, or mark the array of
pointers as const instead of just the things pointed to.

@rdoeffinger
Copy link
Contributor Author

MinGW seems to have some issues:
error: external linkage required for symbol 'boost::re_detail_107200::def_coll_names' because of 'dllexport' attribute
BOOST_REGEX_DECL const char* const def_coll_names[] = {
^
Have not yet figured out what the error is trying to tell me. VS2017 seems to be fine with the code, as well as Linux gcc...

@rdoeffinger
Copy link
Contributor Author

Why is def_coll_names marked as BOOST_REGEX_DECL instead of "static"?
I don't see it used outside the compilation unit...

They increase memory consumption and make exploits
easier and are completely unnecessary.
Avoid them by either avoiding the pointer indirection
completely by using char arrays for strings instead
of char pointers, convert "static" pointer variables
to simple local variables, or mark the array of
pointers as const instead of just the things pointed to.
@rdoeffinger
Copy link
Contributor Author

So just adding "extern" seems to fix the mingw problem.
But see #93 for the alternative of simply not exposing them at all which seems better to me.

@jzmaddock jzmaddock merged commit b5d6069 into boostorg:develop Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants