coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: coreutils and GCC -fanalyzer


From: Pádraig Brady
Subject: Re: coreutils and GCC -fanalyzer
Date: Thu, 21 May 2020 13:29:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Thunderbird/76.0

On 21/05/2020 01:49, Paul Eggert wrote:
The coreutils patch installed on May 10 to pacify GCC 10 -fanalyzer
caused problems when I built coreutils with GCC 10.1.0. Some of the
newly-introduced pragmas generated diagnostics, and the pragmas didn't
seem to be needed in GCC 10.1.0 anyway. As 10.1.0 is the first public
release of GCC 10 I doubt whether we need to support GCC internal
versions (before GCC 10.1.0) that had problems with -fanalyze.

Also, the patch seems to have introduced a bug in tsort.c due to a typo.
Less importantly, it introduced some new overhead in dd.c's non-lint
code (to save some pointers in global variables) that isn't needed and
might cause problems with other static checkers.

To try to fix all this I installed the attached patches.

At some point I hope this GCC 10 stuff settles down, as GCC 10.1.0 still
has bugs in the -fanalyzer area (e.g., see GCC bugs 93644, 95044, 95072)
and we don't want these bugs to adversely affect coreutils etc.

Previously I was testing with the first Fedora 32 (public) GCC:
  gcc (GCC) 10.0.1 20200328 (Red Hat 10.0.1-0.11)

After just upgrading:
  sudo dnf upgrade --advisory=FEDORA-2020-2c6c85202d
  gcc (GCC) 10.1.1 20200507 (Red Hat 10.1.1-1)

I can confirm that the comm.c pragma causes issues for gcc 10.1
  src/comm.c:21:33: error: unknown option after '#pragma GCC diagnostic' kind 
[-Werror=pragmas]
   21 | # pragma GCC diagnostic ignored "-Wanalyzer-use-of-uninitialized-value"

The good news is that this is no longer needed to suppress
-fanalyzer warnings, so we can just remove it.

The other pragmas are still needed though to suppress -fanalyzer warnings.

Also the dd change has minimal overhead and makes valgrind output cleaner.

Good spot on the misplaced #endif in tsort.

I would have went for the smaller attached change,
to avoid the -fanalyzer failures?

thanks for the fixes,
Pádraig

Attachment: coreutils-gcc-fanalyze-fix.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]