[Bug 776447] Re: False-positive and false-negative "Uninitialized variable" warnings

Matthias Klose 776447 at bugs.launchpad.net
Tue Mar 9 17:10:59 UTC 2021


please recheck with newer compiler versions, e.g. gcc-9 or gcc-10, as
found in 20.04 LTS.


** Changed in: gcc-defaults (Ubuntu)
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/776447

Title:
  False-positive and false-negative "Uninitialized variable" warnings

Status in gcc-defaults package in Ubuntu:
  Incomplete

Bug description:
  Gcc bundled with Ubuntu Natty is yielding bad (both false positive and
  false negative) uninitialized variable warnings.

  A false positive was found when compiling BlueZ.  I could not
  reproduce the problem into an smaller example. Problem can be found at
  commit 2b7a21cc33127ee99a4d5077e2dcbabf4396005f, source file
  btio/btio.c, line 803, variable "flushable".

  I put together a false-negative case, which is attached. As it is, the
  error report is ok, but if you change the PROVOKE_ERROR macro to 0, it
  ceases to report the warning, even though it should.

  Looks like these problems are related to variable count. I could not
  reproduce any problem using a single variable. If there are several
  variables (the attached sample has two), it reports uninitialized
  warnings just for the second one.

  Also, error is very sensitive to code present in offending function.
  If you remove the 'switch' from example, error also ceases to be
  reported. Small changes sometimes yield false-negatives.

  ProblemType: Bug
  DistroRelease: Ubuntu 11.04
  Package: gcc 4:4.5.2-1ubuntu3
  ProcVersionSignature: Ubuntu 2.6.38-8.42-generic 2.6.38.2
  Uname: Linux 2.6.38-8-generic i686
  Architecture: i386
  Date: Tue May  3 11:42:16 2011
  InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
  ProcEnviron:
   LANGUAGE=en_US:en
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  SourcePackage: gcc-defaults
  UpgradeStatus: Upgraded to natty on 2011-04-21 (12 days ago)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/776447/+subscriptions



More information about the foundations-bugs mailing list