On 2014-05-07 01:31, Cristian Rodríguez wrote:
Suppose I have a large body of code, of which programmers are lazy and do something like this:
(note that this is a silly example to make my point, the real thing is much more scary)
cat lazy.c
int printf(const char *format, ...);
int main(void) { printf("Problem?"); return 0; }
If you compile that with -Wall -Wextra -pedantic or -WWhatever no warning is emitted and the resulting code calls
Forgive me, my C is rusty and not familiar with Linux coding, but, the above code should call your own version of printf(), not the library one. It is no mistake or error. Yes, your function has the same name as the library one... You mean that the compiler should warn you of the situation? AFAIK, the compiler would only see a problem if you do include the library header for printf(), having doubts as to which one to use. -- Cheers / Saludos, Carlos E. R. (from 13.1 x86_64 "Bottle" at Telcontar)