Skip to content

Conversation

@0x8000-0000
Copy link
Contributor

Supersedes #981 and #982 . Rebased onto current master.

This was referenced Dec 16, 2018
@0x8000-0000
Copy link
Contributor Author

With 8ea3c13, if we enable sign-conversion warnings as part of the FMT_PEDANTIC flag set then we don't get any more warnings in the headers.

There are however several conversion warnings in the test code - but it is heavily templated so I'm not sure how to fix them.

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

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

Looks great, just some minor comments inline. Thanks for working on this!

protected:
// Don't initialize ptr_ since it is not accessed to save a few cycles.
basic_buffer(std::size_t sz) FMT_NOEXCEPT: size_(sz), capacity_(sz) {}
basic_buffer(std::size_t sz) FMT_NOEXCEPT: ptr_(FMT_NULL), size_(sz), capacity_(sz) {}
Copy link
Contributor

@vitaut vitaut Dec 19, 2018

Choose a reason for hiding this comment

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

ptr_ is not initialized intentionally here. This has measurable performance impact on some benchmarks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK - as long as the header does not produce warnings when included in user-level code.

@0x8000-0000
Copy link
Contributor Author

0x8000-0000 commented Dec 19, 2018

Superseded by #989

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