> @rdipardo probably not, the problems are in linking, not in compiling.
Headers can provide `extern` declarations, which compile but still confound the
linker, e.g.
~~~c
/*
* undef.h
*/
extern int foo(void);
~~~
~~~c
/*
* undef.c
*/
#include "undef.h"
int main(void)
{
return foo();
}
~~~
~~~sh-session
$ gcc -Wall -Wextra -c undef.c
$ echo $?
0
$ gcc undef.o
/usr/bin/ld: undef.o: in function `main':
undef.c:(.text+0x5): undefined reference to `foo'
collect2: error: ld returned 1 exit status
~~~
Replacing core type definitions with `extern` declarations in dependent headers
would be a pretty nasty trick on GCC's part, but not impossible.
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1255#issuecomment-1616997356
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany-plugins/issues/1255/[email protected]>