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/81777] New: Compiler doesn't detect wrong function declaration


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

            Bug ID: 81777
           Summary: Compiler doesn't detect wrong function declaration
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jsiebert at poczta dot wp.pl
  Target Milestone: ---

Is it possible to miss wrong declaration of function in seperate include file.

An example:

file testarg.c:
#include <stdio.h>

typedef struct  {
        int c;
} test_t;

void testarg(test_t *t)
{
        printf("c = %d\n", t->c);
        return;
}

file testarg.h:
void testarg(void);

file test.c:
#include "testarg.h"

int main(void)
{
gcc test.c testarg.c -o test
        testarg();
        return 0;
}

compilation with:
gcc -Wall -Werror -pedantic-errors test.c testarg.c -o test

gives no warning or error about wrong testarg() usage.

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