Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 662840 - [Patch] sys-libs/gdbm does not compile with clang
Summary: [Patch] sys-libs/gdbm does not compile with clang
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-05 12:44 UTC by David Carlos Manuelda
Modified: 2018-08-06 09:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
fix Clang compile by providing a correct argument to macro (fix-clang-compile.patch,413 bytes, patch)
2018-08-05 12:44 UTC, David Carlos Manuelda
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Carlos Manuelda 2018-08-05 12:44:00 UTC
Created attachment 542478 [details, diff]
fix Clang compile by providing a correct argument to macro

Since clang is sometimes stricter with errors than gcc, some packages like this one does not compile as they contain not valid C code.

In this case it is using an unspecified parameter as return value of a non-void function:

/tmp/portage/sys-libs/gdbm-1.17/work/gdbm-1.17/src/gdbmsync.c:31:3: error: non-void function 'gdbm_sync' should return a value [-Wreturn-type]
  GDBM_ASSERT_CONSISTENCY (dbf, );
  ^
/tmp/portage/sys-libs/gdbm-1.17/work/gdbm-1.17/src/gdbmdefs.h:278:4: note: expanded from macro 'GDBM_ASSERT_CONSISTENCY'
          return onerr;

I am unable to find upstream bugzilla or similar to report there, so I post my proposed patch to fix it here in look for review and help reporting in the apropriate place, thanks.
Comment 1 Guilherme Amadio gentoo-dev 2018-08-06 07:22:39 UTC
This is also affecting Gentoo prefix on macOS, where clang is the default compiler.
Comment 2 Larry the Git Cow gentoo-dev 2018-08-06 09:36:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69c474500c921c4097c38479674ef6deb83ccfd7

commit 69c474500c921c4097c38479674ef6deb83ccfd7
Author:     Guilherme Amadio <amadio@gentoo.org>
AuthorDate: 2018-08-06 07:46:38 +0000
Commit:     Guilherme Amadio <amadio@gentoo.org>
CommitDate: 2018-08-06 09:34:05 +0000

    sys-libs/gdbm: fix compilation with clang, bug #662840
    
    Closes: https://bugs.gentoo.org/662840
    Package-Manager: Portage-2.3.44, Repoman-2.3.10

 sys-libs/gdbm/files/gdbm-1.17-fix-gdbmsync.patch | 11 +++++++++++
 sys-libs/gdbm/gdbm-1.17.ebuild                   |  2 ++
 2 files changed, 13 insertions(+)