Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 870424 - sys-libs/readline-8.1_p2-r1:0/8[utils] - conftest.c:9:1: error: return type defaults to 'int' [-Werror=implicit-int]
Summary: sys-libs/readline-8.1_p2-r1:0/8[utils] - conftest.c:9:1: error: return type ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard: fixed in 8.1_p2-r1
Keywords: PullRequest
Depends on:
Blocks: c99-porting
  Show dependency tree
 
Reported: 2022-09-16 17:58 UTC by Toralf Förster
Modified: 2024-10-25 20:47 UTC (History)
2 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,18.12 KB, text/plain)
2022-09-16 17:58 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,10.93 KB, text/plain)
2022-09-16 17:58 UTC, Toralf Förster
Details
environment (environment,105.17 KB, text/plain)
2022-09-16 17:58 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,12.80 KB, application/x-bzip)
2022-09-16 17:58 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,2.97 KB, application/x-bzip)
2022-09-16 17:58 UTC, Toralf Förster
Details
sys-libs:readline-8.1_p2-r1:20220916-175415.log (sys-libs:readline-8.1_p2-r1:20220916-175415.log,17.76 KB, text/plain)
2022-09-16 17:58 UTC, Toralf Förster
Details
build.log (8.1_p2-r1) (readline-8.1_p2-r1:20230829-124550.log,65.49 KB, text/plain)
2023-08-29 10:55 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2022-09-16 17:58:29 UTC
cc1: some warnings being treated as errors
CC=cc; CFLAGS=-pipe -march=native -fno-diagnostics-color -O2 -Werror=implicit-function-declaration -Werror=implicit-int; LIBS=;
$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5
configure:3285: error: Can't run the compiler - sorry
configure: error: Can't run the compiler - sorry

## ---------------- ##

  -------------------------------------------------------------------

  This is an unstable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_desktop_systemd-j4-20220916-160005

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-12.2.1 *
clang/llvm (if any):
/usr/lib/llvm/14
14.0.6
Python 3.10.6
Available Rust versions:
  [1]   rust-bin-1.63.0 *
php cli (if any):
GNU Make 4.3

  HEAD of ::gentoo
commit 975d806a2a3cb93cc6bc059cdd90d42d84cbe6e1
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Fri Sep 16 15:31:48 2022 +0000

    2022-09-16 15:31:48 UTC

emerge -qpvO sys-libs/readline
[ebuild     U ] sys-libs/readline-8.1_p2-r1 [8.1_p2] USE="(split-usr) (unicode) utils* -static-libs -verify-sig" ABI_X86="(64) -32 (-x32)"
Comment 1 Toralf Förster gentoo-dev 2022-09-16 17:58:30 UTC
Created attachment 805753 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2022-09-16 17:58:31 UTC
Created attachment 805756 [details]
emerge-history.txt
Comment 3 Toralf Förster gentoo-dev 2022-09-16 17:58:32 UTC
Created attachment 805759 [details]
environment
Comment 4 Toralf Förster gentoo-dev 2022-09-16 17:58:33 UTC
Created attachment 805762 [details]
etc.portage.tar.bz2
Comment 5 Toralf Förster gentoo-dev 2022-09-16 17:58:34 UTC
Created attachment 805765 [details]
logs.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2022-09-16 17:58:36 UTC
Created attachment 805768 [details]
sys-libs:readline-8.1_p2-r1:20220916-175415.log
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-09-17 00:12:23 UTC
checking for library containing strerror... none required
conftest.c:9:1: error: return type defaults to 'int' [-Werror=implicit-int]
    9 | main(){exit(0);}
      | ^~~~
conftest.c: In function 'main':
conftest.c:9:8: error: implicit declaration of function 'exit' [-Werror=implicit-function-declaration]
    9 | main(){exit(0);}
      |        ^~~~
conftest.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
  +++ |+#include <stdlib.h>
    1 | /* confdefs.h */
conftest.c:9:8: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
    9 | main(){exit(0);}
      |        ^~~~
conftest.c:9:8: note: include '<stdlib.h>' or provide a declaration of 'exit'
cc1: some warnings being treated as errors
CC=cc; CFLAGS=-pipe -march=native -fno-diagnostics-color -O2 -Werror=implicit-function-declaration -Werror=implicit-int; LIBS=;
$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5
Comment 8 Lukas Schmelting 2022-12-03 21:35:23 UTC
The newer version (8.2_p1) only has errors about prototypes:
/var/tmp/portage/sys-libs/readline-8.2_p1/work/readline-8.2/text.c:1767:1: error: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]

I have a patch ready for the issues of that version (haven't backported the fix for the error above yet).
Comment 9 Lukas Schmelting 2022-12-12 18:49:26 UTC
Please ignore comment 8, I cannot reproduce both the error in that comment (comment 8) and i also cannot reproduce the error stated in the bug title with clang-common-15.0.6[stricter].
Comment 10 ernsteiswuerfel archtester 2023-08-29 10:55:54 UTC
Created attachment 868978 [details]
build.log (8.1_p2-r1)

Builds just fine with current clang-16 toolchain.

Probably obsolete?
Comment 11 Maxim P. Dementiev 2024-04-10 12:45:03 UTC
I confirm that "-utils" works like a workaround for this c99 bug in readline.
Thanks to  Sam James  in https://bugs.gentoo.org/919256
Comment 12 Larry the Git Cow gentoo-dev 2024-05-11 00:30:18 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f2879693f68d2a9a489d923ffd6e4ff96ec714b

commit 5f2879693f68d2a9a489d923ffd6e4ff96ec714b
Author:     Gabi Falk <gabifalk@gmx.com>
AuthorDate: 2024-05-09 23:15:00 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-11 00:26:39 +0000

    sys-libs/readline: USE=utils: port to modern C (C99)
    
    GCC 14 enables -Werror=implicit-function-declaration and
    -Werror=implicit-int by default.
    
    Closes: https://bugs.gentoo.org/870424
    Closes: https://bugs.gentoo.org/919256
    Link: https://lists.gnu.org/archive/html/bug-readline/2024-05/msg00000.html
    Signed-off-by: Gabi Falk <gabifalk@gmx.com>
    Closes: https://github.com/gentoo/gentoo/pull/36621
    Signed-off-by: Sam James <sam@gentoo.org>

 .../readline/files/readline-8.1-rlfe-c99.patch     | 1201 ++++++++++++++++++++
 sys-libs/readline/readline-8.1_p2-r1.ebuild        |    2 +-
 sys-libs/readline/readline-8.1_p2-r2.ebuild        |    2 +-
 sys-libs/readline/readline-8.2_p10.ebuild          |    2 +-
 sys-libs/readline/readline-8.3_alpha.ebuild        |    1 +
 sys-libs/readline/readline-9999.ebuild             |    1 +
 6 files changed, 1206 insertions(+), 3 deletions(-)