Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 365655

Summary: sys-apps/portage implicit pointer check is broken with gcc-4.5 and later
Product: Portage Development Reporter: William Throwe <wtt6>
Component: UnclassifiedAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal CC: sam
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=870412
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 873757    
Bug Blocks:    

Description William Throwe 2011-05-02 03:30:32 UTC
gcc 4.5 enables -fshow-column by default, which breaks the regular expressions in /usr/lib64/portage/bin/check-implicit-pointer-usage.py

Replacing each "(\d+):" with "(\d+):(?:\d+:)?" seems to fix it and should still work with the old style messages, although I haven't done very much testing.

Reproducible: Always
Comment 1 Zac Medico gentoo-dev 2015-02-28 22:50:36 UTC
I've noticed this same issue with gcc-4.8. The relevant lines from the net-misc/openssh-6.7_p1-r3 build log with USE=X509 looked like this:

ssh-rsa.c: In function ‘ssh_rsa_sign’:
ssh-rsa.c:121:6: warning: assignment makes pointer from integer without a cast [enabled by default]
  sig = xmalloc(slen); /*fatal on error*/
      ^

It caused sshd to crash, as noted in the ChangeLog:

  27 Feb 2015; Patrick McLean <chutzpah@gentoo.org>
  +files/openssh-6.7_p1-xmalloc-include.patch, +openssh-6.7_p1-r4.ebuild:
  Add patch to fix crasher bug triggered on hardened x86_64 machines with
  USE=X509 and ancient clients.
Comment 2 Zac Medico gentoo-dev 2015-03-01 01:45:59 UTC
(In reply to William Throwe from comment #0)
> Replacing each "(\d+):" with "(\d+):(?:\d+:)?" seems to fix it and should
> still work with the old style messages, although I haven't done very much
> testing.

That appears to be a correct fix for the -fshow-column default.

However, I tested this with my build log from openssh-6.7_p1-r3 (see comment #1), and check-implicit-pointer-usage.py doesn't identify that warning as a problem because there's no "implicit declaration" message in the log. The log only contains a "makes pointer from integer" warning. So, I wonder if we should do something to remedy this.
Comment 3 Andreas K. Hüttel archtester gentoo-dev 2018-06-20 21:45:52 UTC
Is this bug still relevant / is the check still broken?
Comment 4 Larry the Git Cow gentoo-dev 2022-11-09 01:17:53 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=85723dbd4d8fa6392001adeb8ca695a29e530949

commit 85723dbd4d8fa6392001adeb8ca695a29e530949
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-11-09 01:16:27 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-11-09 01:17:50 +0000

    bin: replace check-implicit-pointer-usage.py
    
    Always die on -Wimplicit-function-declaration as Clang 16 is going
    to make it fatal and it's always pretty dubious.
    
    The licencing of check-implicit-pointer-usage.py is also unclear,
    but the tool has been broken since GCC 4.5(!)
    
    Bug: https://bugs.gentoo.org/365655
    Bug: https://bugs.gentoo.org/870412
    Signed-off-by: Sam James <sam@gentoo.org>

 bin/check-implicit-pointer-usage.py   | 79 -----------------------------------
 bin/install-qa-check.d/90gcc-warnings | 46 ++++----------------
 2 files changed, 7 insertions(+), 118 deletions(-)
Comment 5 Larry the Git Cow gentoo-dev 2022-11-20 03:06:00 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=203e0d0083b5e7d8098785ec8862c02f6baf5534

commit 203e0d0083b5e7d8098785ec8862c02f6baf5534
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-11-20 03:04:40 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-11-20 03:05:40 +0000

    sys-apps/portage: add 3.0.39
    
    Closes: https://bugs.gentoo.org/365655
    Closes: https://bugs.gentoo.org/757525
    Closes: https://bugs.gentoo.org/871573
    Closes: https://bugs.gentoo.org/875812
    Closes: https://bugs.gentoo.org/875860
    Closes: https://bugs.gentoo.org/877215
    Closes: https://bugs.gentoo.org/877271
    Closes: https://bugs.gentoo.org/877357
    Closes: https://bugs.gentoo.org/877419
    Closes: https://bugs.gentoo.org/873757
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.39.ebuild | 273 +++++++++++++++++++++++++++++++++
 2 files changed, 274 insertions(+)