gcc 1.35 conflicting types message?
Arthur David Olson
ado at elsie.UUCP
Fri May 12 07:12:08 AEST 1989
Thanks to everyone who replied to my question about gcc 1.35 flagging
extern int whatever();
and
extern int whatever(char * format, ...);
as having conflicting types. The consensus is that while the presence of a
"traditional"
extern int whatever();
declaration tells a conforming compiler/interpreter nothing about the
parameters of the function "whatever", it *does* represent a guarantee to
the compiler/interpreter that "whatever" takes some fixed number of arguments.
Folks interested in using gcc to compile X Window System applications may wish
to make the attached change to their "fixincludes" script.
--
Space: Canada, 0 tries ever.
Arthur David Olson ado at ncifcrf.gov ADO is a trademark of Ampex.
*** 1.5/fixincludes Thu May 11 17:02:28 1989
--- 1.6/fixincludes Thu May 11 17:02:28 1989
***************
*** 78,83 ****
--- 78,106 ----
EOF
fi
+ # Deal with yet another challenge, this in X11/Xmu.h
+ file=X11/Xmu.h
+ if [ -r $file ]; then
+ if [ ! -r ${LIB}/$file ]; then
+ mkdir ${LIB}/X11 2>&-
+ cp $file ${LIB}/$file >/dev/null 2>&1 \
+ || echo "Can't copy $file"
+ chmod +w ${LIB}/$file
+ fi
+ fi
+
+ if [ -r ${LIB}/$file ]; then
+ echo Fixing $file sprintf declaration
+ ex ${LIB}/$file <<EOF
+ /^extern char \* sprintf();$/c
+ #ifndef __STDC__
+ extern char * sprintf();
+ #endif /* !defined __STDC__ */
+ .
+ wq
+ EOF
+ fi
+
echo 'Removing unneeded directories:'
cd $LIB
files=`find . -type d -print | sort -r`
More information about the Comp.std.c
mailing list