[gnu.gcc.bug] __STDC__, symout.c, <stdio.h>, fwrite

shep@allspice.lcs.mit.edu (Tim Shepard) (09/25/89)

When I bootstrapped gcc-1.36, I got many warnings while compiling symout.c:

stage1/gcc -Bstage1/ -c -O -g   -I. -I. -I./config symout.c
symout.c: In function symout_init:
symout.c:157: warning: argument passing between incompatible pointer types
symout.c: In function symout_types:
symout.c:341: warning: argument passing between incompatible pointer types
symout.c:465: warning: argument passing between incompatible pointer types
symout.c: In function symout_array_domain:
symout.c:595: warning: argument passing between incompatible pointer types
symout.c: In function symout_range_bounds:
symout.c:608: warning: argument passing between incompatible pointer types
symout.c:614: warning: argument passing between incompatible pointer types
symout.c: In function symout_record_fields:
symout.c:639: warning: argument passing between incompatible pointer types
symout.c: In function symout_enum_values:
symout.c:658: warning: argument passing between incompatible pointer types
symout.c: In function symout_block_symbols:
symout.c:854: warning: argument passing between incompatible pointer types
symout.c: In function symout_block_tags:
symout.c:886: warning: argument passing between incompatible pointer types
symout.c: In function symout_block:
symout.c:946: warning: argument passing between incompatible pointer types
symout.c:949: warning: argument passing between incompatible pointer types
symout.c: In function symout_top_blocks:
symout.c:1058: warning: argument passing between incompatible pointer types
symout.c:1061: warning: argument passing between incompatible pointer types
symout.c:1094: warning: argument passing between incompatible pointer types
symout.c:1097: warning: argument passing between incompatible pointer types
symout.c: In function symout_source_file:
symout.c:1127: warning: argument passing between incompatible pointer types
symout.c: In function symout_sources:
symout.c:1165: warning: argument passing between incompatible pointer types
symout.c: In function symout_finish:
symout.c:1211: warning: argument passing between incompatible pointer types
symout.c:1223: warning: argument passing between incompatible pointer types


I looked at symout.c at all the lines mentioned above, and noticed
that they all had calls to fwrite().  Someone recently added ANSI
prototypes for the stdio library to our /usr/include/stdio.h (all
#ifdef'd __STDC__) and the prototype for fwrite there is:

extern int fwrite(const char*, int, int, FILE*);

The calls to fwrite in symout.c should have casts for the first
arguments.  No?  (Or is there something wrong with this prototype for
fwrite?)

Maybe the warnings above should also indicate which argument is
causing a problem.

				-Tim

shep@ALLSPICE.LCS.MIT.EDU (Tim Shepard) (09/26/89)

It seems that my problem lies in the fwrite prototype in our
/usr/include/stdio.h and not with gcc-1.36.  Thanks to those who
responded.
			-Tim