Skip to content

Commit

Permalink
Always initialize a variable to avoid -Wmaybe-uninitialized
Browse files Browse the repository at this point in the history
This warning is sometimes given (e.g. when using optional<int>) and
can't be easily suppressed from the application code, so ensure the
variable is always initialized to avoid it.

Closes #1037.

See #1038.
  • Loading branch information
vadz committed Apr 18, 2023
1 parent 957afaf commit a4fb0b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/soci/values.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class SOCI_DECL values
indicator * pind = new indicator(indic);
indicators_.push_back(pind);

base_type baseValue;
base_type baseValue{};
type_conversion<T>::to_base(value, baseValue, *pind);

details::copy_holder<base_type> * pcopy =
Expand Down

0 comments on commit a4fb0b0

Please sign in to comment.