fileops.c:1618: warning: weak declaration of `_IO_do_write' after first use results in unspecified behavior

Andreas Jaeger aj@suse.de
Fri Aug 23 01:48:00 GMT 2002


We currently get a number of these warnings with GCC 3.3:
fileops.c:1618: warning: weak declaration of `_IO_do_write' after first use results in unspecified behavior
fileops.c:1621: warning: weak declaration of `_IO_file_finish' after first use results in unspecified behavior
fileops.c:1626: warning: weak declaration of `_IO_file_overflow' after first use results in unspecified behavior
fileops.c:1628: warning: weak declaration of `_IO_file_underflow' after first use results in unspecified behavior
fileops.c:1630: warning: weak declaration of `_IO_file_xsputn' after first use results in unspecified behavior

All of these have in fileops.c an INTDEF2:
INTDEF2(_IO_new_file_underflow, _IO_file_underflow)

hooks.c:84: warning: weak declaration of `__malloc_initialize_hook' after first use results in unspecified behavior
hooks.c:86: warning: weak declaration of `__free_hook' after first use results in unspecified behavior
hooks.c:88: warning: weak declaration of `__malloc_hook' after first use results in unspecified behavior
hooks.c:91: warning: weak declaration of `__realloc_hook' after first use results in unspecified behavior
hooks.c:94: warning: weak declaration of `__memalign_hook' after first use results in unspecified behavior

The variable is declared in malloc.h which is included by malloc.c and
that includes hooks.c.

What's the right fix for these?

- For hooks.c we could declare them in malloc.c before inclusion of
  malloc.h.
- For fileops.c I don't see directly a solution.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj



More information about the Libc-hacker mailing list