Project

General

Profile

Bug #12423

ipf: variable may be used uninitialized

Added by Toomas Soome 9 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
Due date:
% Done:

90%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build errors with gcc 9:

    ../../common/inet/ipf/ip_nat.c: In function 'fr_nataddrsync':
    ../../common/inet/ipf/netinet/ip_nat.h:451:21: error: 'sum2' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      451 |        (s2) = ((s2) & 0xffff) + ((s2) >> 16); \
          |                     ^
    ../../common/inet/ipf/ip_nat.c:4745:15: note: 'sum2' was declared here
     4745 |  u_32_t sum1, sum2, sumd;
          |               ^~~~
    In file included from ../../common/inet/ipf/ip_nat.c:97:
    ../../common/inet/ipf/netinet/ip_nat.h:450:21: error: 'sum1' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      450 |        (s1) = ((s1) & 0xffff) + ((s1) >> 16); \
          |                     ^
    ../../common/inet/ipf/ip_nat.c:4745:9: note: 'sum1' was declared here
     4745 |  u_32_t sum1, sum2, sumd;
          |         ^~~~
    cc1: all warnings being treated as errors

Also available in: Atom PDF