Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
1a4569b4
Commit
1a4569b4
authored
May 06, 2013
by
Leif Walsh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix or suppress errors due to -Wmaybe-uninitialized in GCC 4.8
closes #13
parent
9611670e
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
20 deletions
+37
-20
ft/ft-flusher.cc
ft/ft-flusher.cc
+8
-3
ft/ft-ops.cc
ft/ft-ops.cc
+2
-1
ft/ft.cc
ft/ft.cc
+3
-1
ft/logger.cc
ft/logger.cc
+3
-2
portability/tests/CMakeLists.txt
portability/tests/CMakeLists.txt
+10
-9
src/tests/test_cursor_stickyness.cc
src/tests/test_cursor_stickyness.cc
+3
-0
src/tests/test_txn_nested4.cc
src/tests/test_txn_nested4.cc
+4
-2
src/tests/test_txn_nested5.cc
src/tests/test_txn_nested5.cc
+4
-2
No files found.
ft/ft-flusher.cc
View file @
1a4569b4
...
...
@@ -783,7 +783,8 @@ move_leafentries(
*
num_bytes_moved
=
0
;
for
(
i
=
lbi
;
i
<
ube
;
i
++
)
{
OMTVALUE
lev
;
toku_omt_fetch
(
src_bn
->
buffer
,
i
,
&
lev
);
int
r
=
toku_omt_fetch
(
src_bn
->
buffer
,
i
,
&
lev
);
assert_zero
(
r
);
LEAFENTRY
CAST_FROM_VOIDP
(
curr_le
,
lev
);
size_t
le_size
=
leafentry_memsize
(
curr_le
);
*
num_bytes_moved
+=
leafentry_disksize
(
curr_le
);
...
...
@@ -851,7 +852,7 @@ ftleaf_split(
}
FTNODE
B
;
FTNODE
B
=
nullptr
;
uint32_t
fullhash
;
BLOCKNUM
name
;
...
...
@@ -875,6 +876,9 @@ ftleaf_split(
&
fullhash
,
&
B
);
// GCC 4.8 seems to get confused and think B is maybe uninitialized at link time.
// TODO(leif): figure out why it thinks this and actually fix it.
invariant_notnull
(
B
);
}
...
...
@@ -1245,7 +1249,8 @@ merge_leaf_nodes(FTNODE a, FTNODE b)
// fill in pivot for what used to be max of node 'a', if it is needed
if
(
a_has_tail
)
{
OMTVALUE
lev
;
toku_omt_fetch
(
a_last_buffer
,
toku_omt_size
(
a_last_buffer
)
-
1
,
&
lev
);
int
r
=
toku_omt_fetch
(
a_last_buffer
,
toku_omt_size
(
a_last_buffer
)
-
1
,
&
lev
);
assert_zero
(
r
);
LEAFENTRY
CAST_FROM_VOIDP
(
le
,
lev
);
uint32_t
keylen
;
void
*
key
=
le_key_and_len
(
le
,
&
keylen
);
...
...
ft/ft-ops.cc
View file @
1a4569b4
...
...
@@ -4050,13 +4050,14 @@ ft_cursor_extract_key_and_val(LEAFENTRY le,
*
val
=
le
;
*
vallen
=
leafentry_memsize
(
le
);
}
else
if
(
cursor
->
is_snapshot_read
)
{
le_iterate_val
(
int
r
=
le_iterate_val
(
le
,
does_txn_read_entry
,
val
,
vallen
,
cursor
->
ttxn
);
lazy_assert_zero
(
r
);
*
key
=
le_key_and_len
(
le
,
keylen
);
}
else
{
*
key
=
le_key_and_len
(
le
,
keylen
);
...
...
ft/ft.cc
View file @
1a4569b4
...
...
@@ -474,7 +474,7 @@ int toku_read_ft_and_store_in_cachefile (FT_HANDLE brt, CACHEFILE cf, LSN max_ac
}
}
*
was_open
=
false
;
FT
h
;
FT
h
=
nullptr
;
int
r
;
{
int
fd
=
toku_cachefile_get_fd
(
cf
);
...
...
@@ -485,6 +485,8 @@ int toku_read_ft_and_store_in_cachefile (FT_HANDLE brt, CACHEFILE cf, LSN max_ac
}
}
if
(
r
!=
0
)
return
r
;
// GCC 4.8 seems to get confused by the gotos in the deserialize code and think h is maybe uninitialized.
invariant_notnull
(
h
);
h
->
cf
=
cf
;
h
->
compare_fun
=
brt
->
options
.
compare_fun
;
h
->
update_fun
=
brt
->
options
.
update_fun
;
...
...
ft/logger.cc
View file @
1a4569b4
...
...
@@ -1014,8 +1014,9 @@ int toku_fread_TXNID (FILE *f, TXNID *txnid, struct x1764 *checksum, uint32_t
int
toku_fread_TXNID_PAIR
(
FILE
*
f
,
TXNID_PAIR
*
txnid
,
struct
x1764
*
checksum
,
uint32_t
*
len
)
{
TXNID
parent
;
TXNID
child
;
toku_fread_TXNID
(
f
,
&
parent
,
checksum
,
len
);
toku_fread_TXNID
(
f
,
&
child
,
checksum
,
len
);
int
r
;
r
=
toku_fread_TXNID
(
f
,
&
parent
,
checksum
,
len
);
if
(
r
!=
0
)
{
return
r
;
}
r
=
toku_fread_TXNID
(
f
,
&
child
,
checksum
,
len
);
if
(
r
!=
0
)
{
return
r
;
}
txnid
->
parent_id64
=
parent
;
txnid
->
child_id64
=
child
;
return
0
;
...
...
portability/tests/CMakeLists.txt
View file @
1a4569b4
...
...
@@ -8,6 +8,15 @@ if(BUILD_TESTING)
file
(
GLOB srcs RELATIVE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
"
*.cc
)
foreach
(
src
${
srcs
}
)
get_filename_component
(
test
${
src
}
NAME_WE
)
add_executable
(
${
test
}
${
test
}
)
target_link_libraries
(
${
test
}
${
LIBTOKUPORTABILITY
}
)
set_target_properties
(
${
test
}
PROPERTIES POSITION_INDEPENDENT_CODE ON
)
add_space_separated_property
(
TARGET
${
test
}
COMPILE_FLAGS -fvisibility=hidden
)
list
(
APPEND tests
${
test
}
)
endforeach
(
src
)
include
(
CheckCCompilerFlag
)
check_c_compiler_flag
(
-Wno-unused-result HAVE_WNO_UNUSED_RESULT
)
if
(
HAVE_WNO_UNUSED_RESULT
)
...
...
@@ -16,17 +25,9 @@ if(BUILD_TESTING)
check_c_compiler_flag
(
-Wno-maybe-uninitialized HAVE_WNO_MAYBE_UNINITIALIZED
)
if
(
HAVE_WNO_MAYBE_UNINITIALIZED
)
add_space_separated_property
(
SOURCE try-uninit COMPILE_FLAGS -Wno-maybe-uninitialized
)
add_space_separated_property
(
TARGET try-uninit LINK_FLAGS -Wno-maybe-uninitialized
)
endif
()
foreach
(
src
${
srcs
}
)
get_filename_component
(
test
${
src
}
NAME_WE
)
add_executable
(
${
test
}
${
test
}
)
target_link_libraries
(
${
test
}
${
LIBTOKUPORTABILITY
}
)
set_target_properties
(
${
test
}
PROPERTIES POSITION_INDEPENDENT_CODE ON
)
add_space_separated_property
(
TARGET
${
test
}
COMPILE_FLAGS -fvisibility=hidden
)
list
(
APPEND tests
${
test
}
)
endforeach
(
src
)
configure_file
(
ensure_memcheck_fails.sh . COPYONLY
)
foreach
(
test try-leak-lost try-leak-reachable try-uninit
)
list
(
REMOVE_ITEM tests
${
test
}
)
...
...
src/tests/test_cursor_stickyness.cc
View file @
1a4569b4
...
...
@@ -151,6 +151,9 @@ test_cursor_sticky (int n, int dup_mode) {
DBC
*
cursor
;
r
=
db
->
cursor
(
db
,
0
,
&
cursor
,
0
);
assert
(
r
==
0
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
// GCC 4.8 complains about these being maybe uninitialized.
// TODO(leif): figure out why and fix it.
k
=
0
;
v
=
0
;
r
=
cursor_get
(
cursor
,
&
k
,
&
v
,
DB_NEXT
);
assert
(
r
==
0
);
assert
(
k
==
htonl
(
i
));
assert
(
v
==
htonl
(
i
));
}
...
...
src/tests/test_txn_nested4.cc
View file @
1a4569b4
...
...
@@ -358,8 +358,10 @@ test_txn_nested_jumble (int iteration) {
if
(
min_allowed_branch_level
>=
nest_level
)
{
//start new subtree
int
max
=
nest_level
+
4
;
if
(
MAX_NEST
-
1
<
max
)
max
=
MAX_NEST
-
1
;
assert
(
max
>
nest_level
);
if
(
MAX_NEST
-
1
<
max
)
{
max
=
MAX_NEST
-
1
;
assert
(
max
>
nest_level
);
}
int
branch_level
;
for
(
branch_level
=
nest_level
+
1
;
branch_level
<=
max
;
branch_level
++
)
{
start_txn_and_maybe_insert_or_delete
(
branch_level
);
...
...
src/tests/test_txn_nested5.cc
View file @
1a4569b4
...
...
@@ -377,8 +377,10 @@ test_txn_nested_jumble (int iteration) {
if
(
min_allowed_branch_level
>=
nest_level
)
{
//start new subtree
int
max
=
nest_level
+
4
;
if
(
MAX_NEST
-
1
<
max
)
max
=
MAX_NEST
-
1
;
assert
(
max
>
nest_level
);
if
(
MAX_NEST
-
1
<
max
)
{
max
=
MAX_NEST
-
1
;
assert
(
max
>
nest_level
);
}
int
branch_level
;
for
(
branch_level
=
nest_level
+
1
;
branch_level
<=
max
;
branch_level
++
)
{
start_txn_and_maybe_insert_or_delete
(
branch_level
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment