[Bug c/86125] missing -Wbuiltin-declaration-mismatch on a mismatched return type

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 28 23:21:00 GMT 2019


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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Mon Jan 28 23:21:10 2019
New Revision: 268348

URL: https://gcc.gnu.org/viewcvs?rev=268348&root=gcc&view=rev
Log:
        PR c/86125
        * c-decl.c (last_fileptr_type): Remove.
        (last_structptr_types): New variable.
        (match_builtin_function_types): Compare TYPE_MAIN_VARIANT of
        {old,new}rettype instead of the types themselves.  Assert
        last_structptr_types array has the same number of elements
        as builtin_structptr_types array.  Use TYPE_MAIN_VARIANT for
        argument oldtype and newtype.  Instead of handling
        just fileptr_type_node specially, handle all builtin_structptr_types
        pointer nodes.  Formatting fix.

        * c-common.c (c_common_nodes_and_builtins): Build type variants for
        builtin_structptr_types types even for C.

        * gcc.dg/Wbuiltin-declaration-mismatch-7.c: Guard testcase for
        lp64, ilp32 and llp64 only.
        (fputs): Use unsigned long long instead of size_t for return type.
        (vfprintf, vfscanf): Accept arbitrary target specific type for
        va_list.

Added:
    trunk/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-11.c
Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-decl.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-7.c


More information about the Gcc-bugs mailing list