This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/64526] New: No warning on function call with excessive arguments


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

            Bug ID: 64526
           Summary: No warning on function call with excessive arguments
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chengniansun at gmail dot com

GCC does not warn on the following function call to "fn1". The function "fn1"
is defined with no parameters. Based on the standard, the empty parameter list
in a function declarator that is part of a definition of that function
specifies that the function has no parameters. 


$ cat test.c

void fn1 () {}

void fn2 (int p) {  fn1 (p); }

$ gcc-trunk -Wall -Wextra -pedantic -std=c11 -c test.c

$ clang-trunk -c test.c

test.c:2:27: warning: too many arguments in call to 'fn1'

void fn2 (int p) {  fn1 (p); }

                    ~~~   ^

1 warning generated.

$


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]