buggperf - Bugs: bug #63031, -Wbuiltin-declaration-mismatch in...

 
 

bug #63031: -Wbuiltin-declaration-mismatch in getopt.c on musl

Submitter:  Sam James <thesamesam>
Submitted:  Thu 08 Sep 2022 02:03:56 AM UTC
   
 
Category:  Build Severity:  2 - Minor
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 08 Sep 2022 03:08:52 AM UTC, comment #2: 

Thank you very much!

Sam James <thesamesam>
Thu 08 Sep 2022 02:46:40 AM UTC, comment #1: 
Bruno Haible <haible>
Group administrator
Thu 08 Sep 2022 02:03:56 AM UTC, original submission:  

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.

Sam James <thesamesam>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #53662:  build.log added by thesamesam (10KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by thesamesam (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-09-08 haible CategoryNone Build
        Severity3 - Normal 2 - Minor
        StatusNone Fixed
        Assigned toNone haible
        Open/ClosedOpen Closed
    2022-09-08 thesamesam Attached File- Added build.log, #53662

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code