[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #63031] -Wbuiltin-declaration-mismatch in getopt.c on musl
From: |
Sam James |
Subject: |
[bug #63031] -Wbuiltin-declaration-mismatch in getopt.c on musl |
Date: |
Wed, 7 Sep 2022 22:03:57 -0400 (EDT) |
URL:
<https://savannah.gnu.org/bugs/?63031>
Summary: -Wbuiltin-declaration-mismatch in getopt.c on musl
Project: gperf
Submitter: thesamesam
Submitted: Thu 08 Sep 2022 02:03:56 AM UTC
Category: None
Severity: 3 - Normal
Item Group: None
Status: None
Privacy: Public
Assigned to: None
Open/Closed: Open
Discussion Lock: Any
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Thu 08 Sep 2022 02:03:56 AM UTC By: Sam James <thesamesam>
When building gperf-3.1 with `-Werror=builtin-declaration-mismatch` and Clang
15 on musl:
```
./getopt.c: In function '_getopt_internal':
./getopt.c:611:50: error: 'strncmp' argument 3 type is 'int' where 'unsigned
int' is expected in a call to built-in function declared without prototype
[-Werror=builtin-declaration-mismatch]
611 | if (!strncmp (p->name, nextchar, nameend - nextchar))
| ~~~~~~~~^~~~~~~~~~
./getopt.c:198:12: note: built-in 'strncmp' declared here
198 | extern int strncmp ();
| ^~~~~~~
./getopt.c:800:52: error: 'strncmp' argument 3 type is 'int' where 'unsigned
int' is expected in a call to built-in function declared without prototype
[-Werror=builtin-declaration-mismatch]
800 | if (!strncmp (p->name, nextchar, nameend - nextchar))
| ~~~~~~~~^~~~~~~~~~
./getopt.c:198:12: note: built-in 'strncmp' declared here
198 | extern int strncmp ();
| ^~~~~~~
./getline.cc: In function 'int getstr(char**, size_t*, FILE*, char, size_t)':
./getline.cc:58:20: warning: ISO C++17 does not allow 'register' storage class
specifier [-Wregister]
58 | register int c = getc (stream);
| ^
cc1: some warnings being treated as errors
make[1]: *** [Makefile:85: getopt.o] Error 1
make[1]: Leaving directory
'/var/tmp/portage/dev-util/gperf-3.1/work/gperf-3.1/lib'
make: *** [Makefile:33: all] Error 2
```
Originally reported downstream in Gentoo at https://bugs.gentoo.org/869134.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Thu 08 Sep 2022 02:03:56 AM UTC Name: build.log Size: 10KiB By:
thesamesam
<http://savannah.gnu.org/bugs/download.php?file_id=53662>
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63031>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug #63031] -Wbuiltin-declaration-mismatch in getopt.c on musl,
Sam James <=