Skip to content

Commit

Permalink
from_price and to_price may be uninitialized in extract_comon_prices
Browse files Browse the repository at this point in the history
Fix the compilation error on gcc 10:

    gnucash/libgnucash/engine/gnc-pricedb.c: In function �extract_common_prices�:
    gnucash/libgnucash/engine/gnc-pricedb.c:2469:40: error:
    to_price may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2469 |     if (from_price == NULL || to_price == NULL)
           |                                        ^
           gnucash/libgnucash/engine/gnc-pricedb.c:2469:20:
           error: �from_price� may be used uninitialized in this
           function [-Werror=maybe-uninitialized]
            2469 |     if (from_price == NULL || to_price == NULL)
                  |                    ^
  • Loading branch information
xuhdev committed Apr 29, 2021
1 parent 37afd65 commit 888676e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libgnucash/engine/gnc-pricedb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2439,7 +2439,7 @@ extract_common_prices (PriceList *from_prices, PriceList *to_prices,
{
PriceTuple retval = {NULL, NULL};
GList *from_node = NULL, *to_node = NULL;
GNCPrice *from_price, *to_price;
GNCPrice *from_price = NULL, *to_price = NULL;

for (from_node = from_prices; from_node != NULL;
from_node = g_list_next(from_node))
Expand Down

0 comments on commit 888676e

Please sign in to comment.