https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86125

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Known to work|                            |9.0
         Resolution|---                         |FIXED
   Target Milestone|---                         |9.0
      Known to fail|                            |8.2.0

--- Comment #6 from Martin Sebor <msebor at gcc dot gnu.org> ---
The warning has been enhanced to detect the strlen mismatch in r268251, but it
requires -Wextra.  This was done to avoid diagnosing some more-or-less benign
mismatches (like in const qualifiers) but I don't think it applies as well when
the mismatch is between an integer and pointer.  But I suppose tightening that
up will need to wait for the future.  Let me resolve this as fixed and think
about opening a new bug for that.

$ gcc -S -Wall -Wextra pr86125.c
pr86125.c:1:7: warning: conflicting types for built-in function ‘strdup’;
expected ‘char *(const char *)’ [-Wbuiltin-declaration-mismatch]
    1 | char* strdup (int);            // warning (good)
      |       ^~~~~~
pr86125.c:2:7: warning: mismatch in return type of built-in function ‘strlen’;
expected ‘long unsigned int’ [-Wbuiltin-declaration-mismatch]
    2 | char* strlen (const char*);    // missing warning
      |       ^~~~~~

Reply via email to