Well, I'll be damned.
But that is only true for C compilers. C++ compilers do indeed give an error about the missing function declaration. Using arm-linux-gcc (it's the only gcc I have handy) and the Visual C++ 2005 command line compiler.
Code:
D:\Temp>type test.c
int main(int argc, char *argv[])
{
ninja();
}
D:\Temp>arm-linux-gcc -c test.c
D:\Temp>cl /c test.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
test.c
D:\Temp>ren test.c test.cpp
D:\Temp>arm-linux-gcc -c test.cpp
test.cpp: In function 'int main(int, char**)':
test.cpp:3: error: 'ninja' was not declared in this scope
D:\Temp>cl /c test.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
test.cpp
test.cpp(3) : error C3861: 'ninja': identifier not found
D:\Temp>
Bookmarks