Dan Espen wrote:
> fork> gcc x.c
> x.c: In function `warn':
> x.c:13: warning: assignment makes pointer from integer without a cast
> x.c:13: warning: assignment makes integer from pointer without a cast
> x.c:14: warning: assignment makes integer from pointer without a cast
> x.c:14: warning: assignment from incompatible pointer type
>
> Maybe someone else on the list can clarify.
>
After a little experimentation and research, it seems that nested
functions are forbidden by ISO C but allowed by ANSI (resulting in
functions with limited scope.) gcc will generate a warning about the
nested function if you compile with -pedantic; Forte is notorious for
being pedantic all the time ;)
Anyway, the actual test is defined in configure.in:
dnl catch -Werror and similar options when running configure
AC_TRY_COMPILE([#include <stdio.h>],
[int warn(void) {
int i; static j; int *p; char *c;
switch (*p = p = *c) { case 0: printf("%Q", c, p); }
*c = &i; c = p;
while (1 || (unsigned int)3 >= 0 || ((int)-1) == ((unsigned int)1));
return; }], , AC_MSG_ERROR("
configure is not able to compile programs with warnings. Please
remove all offending options like -Werror from the CFLAGS and
CPPFLAGS variables and run configure again."))
According to the autoconf manual, only the function body is supposed to
be passed as the second argument--the function declaration itself ('int
warn(void) {') should be dropped, and that will hopefully fix the
problem. I don't have a Solaris box to test that on, though.
--
Ben
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
- application/pgp-signature attachment: stored
Received on Sat Feb 22 2003 - 15:46:58 GMT