drazen@VLSI.CALTECH.EDU (Drazen Borkovic) (11/23/88)
The compiler issues a warning about the call to
the function "Free" and it does not about one to
the function "G".
Is this correct?
------------------------------------------------
Script started on Tue Nov 22 22:30:16 1988
!21 -> alias gcc
gcc -ansi -pedantic -Wall -Wwrite-strings
!22 -> gcc -v -S j.c
gcc version 1.31
/usr/local/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -T -$ -D__STRICT_ANSI__ -pedantic -Wall -D__HAVE_68881__ -Dmc68020 j.c /tmp/cca16871.cpp
GNU CPP version 1.31
/usr/local/lib/gcc-cc1 /tmp/cca16871.cpp -quiet -dumpbase j.c -Wall -Wwrite-strings -pedantic -ansi -version -o j.s
GNU C version 1.31 (68k, MIT syntax) compiled by GNU C version 1.31.
j.c: In function f:
j.c:12: warning: argument passing of non-const * pointer from const *
!23 -> cat j.c
typedef void * void_ptr;
extern void Free (const void_ptr p);
extern void G(const void * p);
int f(void)
{
const char *q;
Free(q);
G(q);
return 1;
}
!24 -> exit
script done on Tue Nov 22 22:30:51 1988
------------------------------------------------
Drazen Borkovic, Caltech 256-80, Pasadena, CA 91125
e-mail: drazen@vlsi.caltech.edu
jdn@mas.UUCP (Jeff Nisewanger) (04/04/89)
In gcc-1.34 In file varasm.c In function make_decl_rtl Near line 213 1 /* Now handle ordinary static variables and functions (in memory). 2 Also handle vars declared register invalidly. */ 3 X if (DECL_RTL (decl) == 0) 4 X { 5 X if (DECL_RTL (decl) && asmspec == 0) 6 name = XSTR (XEXP (DECL_RTL (decl), 0), 0); 7 8 /* Can't use just the variable's own name for a variable 9 whose scope is less than the whole file. 10 Concatenate a distinguishing number. */ 11 else if (!top_level && !TREE_EXTERNAL (decl) && asmspec == 0) 12 { Since DECL_RTL(decl) is checked for "0" on psuedo-line 3 the "if" statement conditional expression on psuedo-line 5 will never be true. Jeff Nisewanger Measurex Automation Systems ...apple!mas1!jdn