Project

General

Profile

Bug #12423

ipf: variable may be used uninitialized

Added by Toomas Soome 9 months ago. Updated 8 months ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

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

Testing done: build/install/boot

#1

Updated by Toomas Soome 8 months ago

  • Description updated (diff)
#2

Updated by Electric Monk 8 months ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 5338faaac2dc1b2a16cb1a986233578834926ce0

commit  5338faaac2dc1b2a16cb1a986233578834926ce0
Author: Toomas Soome <tsoome@me.com>
Date:   2020-03-31T16:56:15.000Z

    12423 ipf: variable may be used uninitialized
    Reviewed by: Robert Mustacchi <rm@fingolfin.org>
    Reviewed by: Gary Mills <gary_mills@fastmail.fm>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF