-   Programming (
-   -   removing warnings (

h/w 01-26-2004 03:06 PM

removing warnings
hi, when we dont include the headers in C, and call printf() or exit(), we get the warning of an implicit declaration of those functions.
is there a way to not get these warnings, and not include the headers at the same time?


Strike 01-26-2004 03:41 PM

Why wouldn't you include the headers explicitly? It gets done anyway.

acid_kewpie 01-26-2004 03:43 PM

you really shouldn't approach problems in this direction... you are clearly not using the language correctly, but you still want to fight it??

h/w 01-26-2004 03:43 PM

hmm .. yeah.
well, was just wondering.
thanks. :)

coolman0stress 01-26-2004 03:45 PM

what compiler are you using? I'm sure there is a way to supress warnings.

But like Strike mentioned, just include the headers.

h/w 01-26-2004 03:45 PM

gcc 3.
yeah, it's ok. was just wondering - that's all. :)

jim mcnamara 01-26-2004 05:06 PM

The answer is: extern int printf

But it isn't a good answer. If you ever read the /usr/include/nnn.h files you'll see why. There are all kinds of things that are declared different ways in different environments. eg., as macros vs functions or as float vs double.

All of this could become a problem for you running your code.

All times are GMT -5. The time now is 04:55 AM.