Mail Archives: djgpp/1997/06/26/01:48:35
On Wed, 25 Jun 1997, Thomas Christensen wrote:
> When I compile a small program, which has
> #include <cinio.h>
> #include <pc.h>
> in it I get 2 warnings
>
> .../pc.h(32) Warning: redundant redeclaration of `_conio_kbhit' in
> same scope
<pc.h> declares `kbhit', but <conio.h> both defines it to be
`_conio_kbhit' and declares `_conio_kbhit', so gcc sees two
declarations of `_conio_kbhit'. Usually, gcc doesn't complain about
such cases *unless* you use the `-Wredundant-decls' option (-Wall
doesn't turn it on). Did you indeed use this option? If so, you
should have told this in your message, as its usage is non-standard.
A simple solution is not to use `-Wredundant-decls'; it is redundant
;-) But if you want to stick to it, you need to decide whether you
indeed need to include both of these headers (most programs only need
one, but not the other). If you *do* need them both, include <pc.h>
first:
#include <pc.h>
#include <conio.h>
This should work even with `-Wredundant-decls' (it did for me).
- Raw text -