[gnu.g++.bug] possible spurious warning

karl@mote.umb.edu ("Karl Berry.") (03/22/89)

This is with g++1.34.0 on a Sun 3 running 3.4.

It seems that a typedef'ed type is not always the same as the
original type, when combined with `...'. The following program
declares two functions which differ only in whether the argument
is `char*' or `string'. g++ complains about the `string' one
(argument passing of integer from pointer lacks a cast) but not that
char*.

Perhaps this behavior is correct. I was never clear about the status
of typedefs in C++.

Incidentally, perhaps the message ``argument passing of <formal> from
<actual>'' could be changed to ``argument passing of <actual> to <formal>'', 
which is a little less convoluted, at least to me.

Karl karl@umb.edu

typedef char* string;

extern void f1(char* ...);
extern void f2(string ...);

main()
{
   f1("no warning");
   f2("warning");
}

g++ -v -c x.cc
g++ version 1.34.0
 /usr/local/gnu/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_FPU__ -Dmc68020 x.cc /tmp/cca10817.cpp
GNU CPP version 1.34
 /usr/local/gnu/lib/gcc-c++ /tmp/cca10817.cpp -quiet -dumpbase x.cc -noreg -version -o /tmp/cca10817.s
GNU C++ version 1.34.0 (68k, MIT syntax) compiled by GNU C version 1.34.
In function int main ():
x.cc:9: warning: argument passing of integer from pointer lacks a cast
 as -mc68020 /tmp/cca10817.s -o x.o