rocksdb/util
Daniel Black e5ae1bb465 Remove bogus gcc-8.1 warning (#3870)
Summary:
Various rearrangements of the cch maths failed or replacing = '\0' with
memset failed to convince the compiler it was nul terminated. So took
the perverse option of changing strncpy to strcpy.

Return null if memory couldn't be allocated.

util/status.cc: In static member function ‘static const char* rocksdb::Status::CopyState(const char*)’:
util/status.cc:28:15: error: ‘char* strncpy(char*, const char*, size_t)’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
   std::strncpy(result, state, cch - 1);
   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
util/status.cc:19:18: note: length computed here
       std::strlen(state) + 1; // +1 for the null terminator
       ~~~~~~~~~~~^~~~~~~
cc1plus: all warnings being treated as errors
make: *** [Makefile:645: shared-objects/util/status.o] Error 1

closes #2705
Closes https://github.com/facebook/rocksdb/pull/3870

Differential Revision: D8594114

Pulled By: anand1976

fbshipit-source-id: ab20f3a456a711e4d29144ebe630e4fe3c99ec25
2018-06-27 12:23:07 -07:00
..
aligned_buffer.h Improve direct IO range scan performance with readahead (#3884) 2018-06-21 11:13:08 -07:00
allocator.h
arena.cc comment unused parameters to turn on -Wunused-parameter flag 2018-04-12 17:59:16 -07:00
arena.h arena: derive alignment unit from std::max_align_t 2017-10-17 11:13:19 -07:00
arena_test.cc arena: derive alignment unit from std::max_align_t 2017-10-17 11:13:19 -07:00
auto_roll_logger.cc
auto_roll_logger.h Fix the Logger::Close() and DBImpl::Close() design pattern 2018-02-23 13:57:26 -08:00
auto_roll_logger_test.cc fix memory leak in two_level_iterator 2018-04-15 17:26:26 -07:00
autovector.h
autovector_test.cc fix memory leak in two_level_iterator 2018-04-15 17:26:26 -07:00
bloom.cc comment unused parameters to turn on -Wunused-parameter flag 2018-04-12 17:59:16 -07:00
bloom_test.cc fix gflags namespace 2017-12-01 10:42:05 -08:00
build_version.cc.in
build_version.h
cast_util.h
channel.h
coding.cc Enable MSVC W4 with a few exceptions. Fix warnings and bugs 2017-10-19 10:57:12 -07:00
coding.h
coding_test.cc
compaction_job_stats_impl.cc comment unused parameters to turn on -Wunused-parameter flag 2018-04-12 17:59:16 -07:00
comparator.cc use user_key and iterate_upper_bound to determine compatibility of bloom filters (#3899) 2018-06-26 15:57:26 -07:00
compression.h ZSTD compression: should also expect type = kZSTDNotFinalCompression (#3964) 2018-06-06 23:42:29 -07:00
compression_context_cache.cc run make format for PR 3838 (#3954) 2018-06-05 12:58:02 -07:00
compression_context_cache.h run make format for PR 3838 (#3954) 2018-06-05 12:58:02 -07:00
concurrent_arena.cc
concurrent_arena.h util: Fix coverity issues 2017-11-03 14:42:08 -07:00
core_local.h
crc32c.cc Suppress UBSAN error in finer guanularity 2018-02-13 12:18:07 -08:00
crc32c.h
crc32c_ppc.c
crc32c_ppc.h
crc32c_ppc_asm.S
crc32c_ppc_constants.h
crc32c_test.cc Build and tests fixes for Solaris Sparc (#4000) 2018-06-15 12:42:53 -07:00
delete_scheduler.cc Sync parent directory after deleting a file in delete scheduler 2018-04-26 13:58:20 -07:00
delete_scheduler.h Sync parent directory after deleting a file in delete scheduler 2018-04-26 13:58:20 -07:00
delete_scheduler_test.cc Sync parent directory after deleting a file in delete scheduler 2018-04-26 13:58:20 -07:00
duplicate_detector.h Improve db_stress with transactions 2018-04-18 16:32:35 -07:00
dynamic_bloom.cc Use nullptr instead of NULL / 0 more consistently. 2018-03-07 12:42:12 -08:00
dynamic_bloom.h Enable MSVC W4 with a few exceptions. Fix warnings and bugs 2017-10-19 10:57:12 -07:00
dynamic_bloom_test.cc fix gflags namespace 2017-12-01 10:42:05 -08:00
event_logger.cc
event_logger.h
event_logger_test.cc
fault_injection_test_env.cc
fault_injection_test_env.h Fix FaultInjectionTestEnv to work with DirectIO 2018-03-14 00:57:24 -07:00
file_reader_writer.cc Improve direct IO range scan performance with readahead (#3884) 2018-06-21 11:13:08 -07:00
file_reader_writer.h Improve direct IO range scan performance with readahead (#3884) 2018-06-21 11:13:08 -07:00
file_reader_writer_test.cc Comment out unused variables 2018-03-05 13:13:41 -08:00
file_util.cc Add file name info to SequentialFileReader. (#4026) 2018-06-21 08:42:24 -07:00
file_util.h Sync parent directory after deleting a file in delete scheduler 2018-04-26 13:58:20 -07:00
filelock_test.cc Check with PosixEnv before opening LOCK file (#3993) 2018-06-13 17:32:04 -07:00
filename.cc
filename.h
filter_policy.cc
gflags_compat.h fix gflags namespace 2017-12-01 10:42:05 -08:00
hash.cc
hash.h
hash_map.h
hash_test.cc
heap.h
heap_test.cc fix gflags namespace 2017-12-01 10:42:05 -08:00
kv_map.h
log_buffer.cc
log_buffer.h
log_write_bench.cc fix gflags namespace 2017-12-01 10:42:05 -08:00
logging.h
memory_usage.h
murmurhash.cc Suppress UBSAN error in finer guanularity 2018-02-13 12:18:07 -08:00
murmurhash.h
mutexlock.h
ppc-opcode.h
random.cc
random.h
rate_limiter.cc
rate_limiter.h
rate_limiter_test.cc comment unused parameters to turn on -Wunused-parameter flag 2018-04-12 17:59:16 -07:00
set_comparator.h WritePrepared Txn: Move DuplicateDetector to util 2018-03-05 23:57:12 -08:00
slice.cc use user_key and iterate_upper_bound to determine compatibility of bloom filters (#3899) 2018-06-26 15:57:26 -07:00
slice_transform_test.cc
sst_file_manager_impl.cc Sync parent directory after deleting a file in delete scheduler 2018-04-26 13:58:20 -07:00
sst_file_manager_impl.h Sync parent directory after deleting a file in delete scheduler 2018-04-26 13:58:20 -07:00
status.cc Remove bogus gcc-8.1 warning (#3870) 2018-06-27 12:23:07 -07:00
status_message.cc
stderr_logger.h
stop_watch.h
string_util.cc Several small "fixes" 2018-02-15 16:57:37 -08:00
string_util.h
sync_point.cc Refactor sync_point to make implementation either customizable or replaceable 2018-03-23 12:56:52 -07:00
sync_point.h Fix singleton destruction order of PosixEnv and SyncPoint (#3951) 2018-06-04 15:58:46 -07:00
sync_point_impl.cc Avoid acquiring SyncPoint mutex when it is disabled (#3991) 2018-06-13 13:13:18 -07:00
sync_point_impl.h Avoid acquiring SyncPoint mutex when it is disabled (#3991) 2018-06-13 13:13:18 -07:00
testharness.cc
testharness.h
testutil.cc Pin top-level index on partitioned index/filter blocks (#4037) 2018-06-22 15:27:46 -07:00
testutil.h Add file name info to SequentialFileReader. (#4026) 2018-06-21 08:42:24 -07:00
thread_list_test.cc Use nullptr instead of NULL / 0 more consistently. 2018-03-07 12:42:12 -08:00
thread_local.cc util: Fix coverity issues 2017-11-03 14:42:08 -07:00
thread_local.h Provide a way to override windows memory allocator with jemalloc for ZSTD 2018-06-04 12:12:48 -07:00
thread_local_test.cc Comment out unused variables 2018-03-05 13:13:41 -08:00
thread_operation.h
threadpool_imp.cc Support lowering CPU priority of background threads 2018-04-24 08:41:51 -07:00
threadpool_imp.h Support lowering CPU priority of background threads 2018-04-24 08:41:51 -07:00
timer_queue.h
timer_queue_test.cc
transaction_test_util.cc WritePrepared Txn: enable rollback in stress test 2018-05-02 18:13:05 -07:00
transaction_test_util.h WritePrepared Txn: stress test 2017-12-06 09:42:28 -08:00
xxhash.cc
xxhash.h