Skip to content

ICC fixes#738

Merged
deanberris merged 2 commits into
cpp-netlib:0.13-releasefrom
BlueBrain:0.13-release
Mar 1, 2017
Merged

ICC fixes#738
deanberris merged 2 commits into
cpp-netlib:0.13-releasefrom
BlueBrain:0.13-release

Conversation

@eile

@eile eile commented Mar 1, 2017

Copy link
Copy Markdown

const-qualify function-local static constant arrays.

if (boost::empty(content_type_headers)) {
typedef typename char_<Tag>::type char_type;
static char_type content_type[] = "x-application/octet-stream";
static char_type* content_type = "x-application/octet-stream";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose a better change here would be:

static char_type const content_type[] = "...";

@eile

eile commented Mar 1, 2017

Copy link
Copy Markdown
Author

Updated.

@deanberris

Copy link
Copy Markdown
Member

LGTM -- thanks @eile!

@deanberris deanberris merged commit f17d305 into cpp-netlib:0.13-release Mar 1, 2017
@eile eile mentioned this pull request Mar 1, 2017
@dnachbaur

Copy link
Copy Markdown

@deanberris your requested change actually does not work, at least with icc 17:

boost/network/protocol/http/client/facade.hpp(134): error: a value of type "const char [27]" cannot be used to initialize an entity of type "const char_type []"
          static char_type const content_type[] = "x-application/octet-stream";

I suggest to keep the initial code change by @eile:

static char_type* const content_type = "x-application/octet-stream";

I just verified that this compiles.

@deanberris

Copy link
Copy Markdown
Member

@tribal-tec -- that's interesting, why isn't this an ICC bug?

If you send me a pull request I'd be happy to review and merge it.

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.

3 participants