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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Florian Weimer <f...@gcc.gnu.org>:

https://gcc.gnu.org/g:701d8e7e60b85809cae348c1e9edb3b0f4924325

commit r15-5369-g701d8e7e60b85809cae348c1e9edb3b0f4924325
Author: Florian Weimer <fwei...@redhat.com>
Date:   Sun Nov 17 19:42:33 2024 +0100

    c: Implement -Wdeprecated-non-prototype

    This warning covers the C23 incompibilities resulting from using
    () as parameter lists in function declarations.

    The warning name comes from Clang.  The implementation is not
    perfect because GCC treats these two declarations as equivalent:

      void f ();
      void f (not_a_type);

    This is a bit confusing because they are clearly visually distinct.
    However, as of GCC 14, the second form is an error by default, so
    treating both the same as far as  -Wdeprecated-non-prototype does
    not seem so bad from a user experience view.

    gcc/c-family/

            PR c/95445
            * c-opts.cc (c_common_post_options): Initialize
            warn_deprecated_non_prototype.
            * c.opt (Wdeprecated-non-prototype): New option.
            * c.opt.urls: Regenerate.

    gcc/c/

            PR c/95445
            * c-decl.cc (start_function): Warn about parameters
            after parameter-less declaration.
            * c-typeck.cc (build_function_call_vec): Pass fntype
            to convert_arguments.
            (convert_arguments): Change argument to fntype and
            compute typelist.  Warn about parameter list mismatches
            on first parameter.

    gcc/

            PR c/95445
            * doc/invoke.texi: Document -Wdeprecated-non-prototype.

    gcc/testsuite/

            PR c/95445
            * gcc.dg/Wdeprecated-non-prototype-1.c: New test.
            * gcc.dg/Wdeprecated-non-prototype-2.c: New test.
            * gcc.dg/Wdeprecated-non-prototype-3.c: New test.
            * gcc.dg/Wdeprecated-non-prototype-4.c: New test.

Reply via email to