http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48091

           Summary: No warning when given function arguments mismatch
                    earlier, old style K&R function definition
           Product: gcc
           Version: 4.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: eer...@gmail.com


Program:
----------
int test(a, b)
        int a;
        int b;
{
        return a+b;
}
int main(void)
{
        return test("foo");
}
----------

With all of these compiler options:
- gcc -Wall -Wextra --std=c99 -pedantic -O test.c

The expected output is similar to other compilers i.e.:
- a warning about arguments mismatching
  (As all argument types and number of them are fully specified), or
- warning about incomplete function definition

Actual outcome:
- No warnings about anything

(With -O2, GCC inlines the function and then finds a mismatch and I of course
can use -Wold-style-definition warning option, but that's beside the point.)

GCC version:
- 4.4.5 in Debian Squeeze

Reply via email to