Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gcc-7 buffer size insufficient #1673

Closed
wants to merge 4 commits into from
Closed

Gcc-7 buffer size insufficient #1673

wants to merge 4 commits into from

Conversation

grooverdan
Copy link
Contributor

Bunch of commits related to insufficient buffer size. Errors in individual commits.

Fixes gcc error:

util/transaction_test_util.cc:188:8: error: output may be truncated before the last format character [-Werror=format-length=]
 Status RandomTransactionInserter::Verify(DB* db, uint16_t num_sets) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~
util/transaction_test_util.cc:194:60: note: format output between 5 and 6 bytes into a destination of size 5
     snprintf(prefix_buf, sizeof(prefix_buf), "%.4u", i + 1);
Error:

utilities/transactions/transaction_util.cc:53:8: error: output may be truncated before the last format character [-Werror=format-length=]
 Status TransactionUtil::CheckKey(DBImpl* db_impl, SuperVersion* sv,
        ^~~~~~~~~~~~~~~
utilities/transactions/transaction_util.cc:94:38: note: format output between 257 and 295 bytes into a destination of size 255
                key_seq, earliest_seq);
gcc-7 error:
utilities/simulator_cache/sim_cache.cc:135:23: error: '%%' directive output truncated while writing 1 byte into a region of size 0 [-Werror=format-length=]
   virtual std::string ToString() const override {
                       ^~~~~~~~
utilities/simulator_cache/sim_cache.cc:142:72: note: format output between 25 and 334 bytes into a destination of size 100
              (lookups == 0 ? 0 : get_hit_counter() * 100.0f / lookups));
gcc-7 error:

tools/db_bench_tool.cc: In member function 'void rocksdb::Benchmark::Compress(rocksdb::ThreadState*)':
tools/db_bench_tool.cc:2598:8: error: '%%' directive output truncated while writing 1 byte into a region of size 0 [-Werror=format-length=]
   void Compress(ThreadState *thread) {
        ^~~~~~~~
tools/db_bench_tool.cc:2620:43: note: format output between 15 and 324 bytes into a destination of size 100
                (produced * 100.0) / bytes);
                                           ^
cc1plus: all warnings being treated as errors
Makefile:1521: recipe for target 'tools/db_bench_tool.o' failed
make: *** [tools/db_bench_tool.o] Error 1
@facebook-github-bot
Copy link
Contributor

@IslamAbdelRahman has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@grooverdan grooverdan deleted the gcc-7-buffer-size-insufficient branch December 15, 2016 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants