[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: example include file path in tool output
There are three files a.c (that is compilation source file), a.h (included by a.c), and foo.c (that is included by a.h.
Jim -------------------------------------------------------------------------------- a.c -------------------------------------------------------------------------------- #include <stdio.h> #include "a.h" int main(int argc, char **argv) { foo(argc, argv); } -------------------------------------------------------------------------------- a.h -------------------------------------------------------------------------------- #include "foo.c" -------------------------------------------------------------------------------- foo.c -------------------------------------------------------------------------------- void foo(void) { printf("hello world\n"); } -------------------------------------------------------------------------------- output of running: gcc -Wall -Wextra a.c -------------------------------------------------------------------------------- a.c: In function ‘main’: a.c:6:5: error: too many arguments to function ‘foo’ foo(argc, argv); ^ In file included from a.h:1:0, from a.c:2: foo.c:1:6: note: declared here void foo(void) ^
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]