all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* "incompatible implicit declaration" warnings with GCC 4.2.1
@ 2007-10-22 15:24 Juanma Barranquero
  2007-10-22 21:08 ` Eli Zaretskii
  0 siblings, 1 reply; 13+ messages in thread
From: Juanma Barranquero @ 2007-10-22 15:24 UTC (permalink / raw)
  To: Emacs Devel

  C:\emacs> gcc --version
  gcc (GCC) 4.2.1-sjlj (mingw32-2)
  Copyright (C) 2007 Free Software Foundation, Inc.

Compilation produces these warnings. They don't happen with gcc 3.4.5 (MinGW):

  gcc -I. -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0400 -D_X86_=1 -c
-gstabs+ -g3 -mno-cygwin -mtune=pentium4 -O2  -Di386 -D_CRTAPI1=_cdecl
-Demacs=1 -DWINDOWSNT -DDOS_NT -DHAVE_CONFIG_H -I../nt/inc -D_UCHAR_T
-DHAVE_NTGUI=1 -DUSE_CRT_DLL=1 -DPURESIZE=5000000 -o
oo-spd/i386/w32fns.o w32fns.c
  w32fns.c: In function 'gamma_correct':
  w32fns.c:1241: warning: incompatible implicit declaration of
built-in function 'pow'
  w32fns.c: In function 'w32_abort':
  w32fns.c:9127: warning: incompatible implicit declaration of
built-in function 'abort'

             Juanma

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: "incompatible implicit declaration" warnings with GCC 4.2.1
  2007-10-22 15:24 "incompatible implicit declaration" warnings with GCC 4.2.1 Juanma Barranquero
@ 2007-10-22 21:08 ` Eli Zaretskii
  2007-10-22 21:29   ` Juanma Barranquero
  0 siblings, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2007-10-22 21:08 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: emacs-devel

> Date: Mon, 22 Oct 2007 17:24:49 +0200
> From: "Juanma Barranquero" <lekktu@gmail.com>
> 
>   gcc -I. -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0400 -D_X86_=1 -c
> -gstabs+ -g3 -mno-cygwin -mtune=pentium4 -O2  -Di386 -D_CRTAPI1=_cdecl
> -Demacs=1 -DWINDOWSNT -DDOS_NT -DHAVE_CONFIG_H -I../nt/inc -D_UCHAR_T
> -DHAVE_NTGUI=1 -DUSE_CRT_DLL=1 -DPURESIZE=5000000 -o
> oo-spd/i386/w32fns.o w32fns.c
>   w32fns.c: In function 'gamma_correct':
>   w32fns.c:1241: warning: incompatible implicit declaration of
> built-in function 'pow'
>   w32fns.c: In function 'w32_abort':
>   w32fns.c:9127: warning: incompatible implicit declaration of
> built-in function 'abort'

Does it help to include <math.h> and <stdlib.h> in w32fns.c?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: "incompatible implicit declaration" warnings with GCC 4.2.1
  2007-10-22 21:08 ` Eli Zaretskii
@ 2007-10-22 21:29   ` Juanma Barranquero
  2007-10-22 21:45     ` Jason Rumney
  0 siblings, 1 reply; 13+ messages in thread
From: Juanma Barranquero @ 2007-10-22 21:29 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On 10/22/07, Eli Zaretskii <eliz@gnu.org> wrote:

> Does it help to include <math.h> and <stdlib.h> in w32fns.c?

<math.h> helps for the `abs' warning.

<stdlib.h> does not help for the `abort' warning. w32fns.c has a dozen
abort() calls, and then

 #undef abort

followed by w32_abort, which has the `abort' call that causes the
warning. Why so?

             Juanma

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: "incompatible implicit declaration" warnings with GCC 4.2.1
  2007-10-22 21:29   ` Juanma Barranquero
@ 2007-10-22 21:45     ` Jason Rumney
  2007-10-22 21:55       ` Juanma Barranquero
  0 siblings, 1 reply; 13+ messages in thread
From: Jason Rumney @ 2007-10-22 21:45 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Eli Zaretskii, emacs-devel

Juanma Barranquero wrote:
> <stdlib.h> does not help for the `abort' warning. w32fns.c has a dozen
> abort() calls, and then
>
>  #undef abort
>
> followed by w32_abort, which has the `abort' call that causes the
> warning. Why so?
>   

stdlib.h needs to be included before whichever header it is that contains

#define abort w32_abort

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: "incompatible implicit declaration" warnings with GCC 4.2.1
  2007-10-22 21:45     ` Jason Rumney
@ 2007-10-22 21:55       ` Juanma Barranquero
  2007-10-22 22:46         ` Jason Rumney
  2007-10-23  4:05         ` Eli Zaretskii
  0 siblings, 2 replies; 13+ messages in thread
From: Juanma Barranquero @ 2007-10-22 21:55 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Eli Zaretskii, emacs-devel

On 10/22/07, Jason Rumney <jasonr@gnu.org> wrote:

> stdlib.h needs to be included before whichever header it is that contains
>
> #define abort w32_abort

That's src/s/ms-w32.h, which is included from config.h. Including
<stdlib.h> before config.h produces this new error:

  w32fns.c:9105: warning: conflicting types for 'w32_abort'
  w32fns.c:496: warning: previous implicit declaration of 'w32_abort' was here

I'd really like to know why this include shuffling is suddenly needed
with GCC 4.2.1...

             Juanma

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: "incompatible implicit declaration" warnings with GCC 4.2.1
  2007-10-22 21:55       ` Juanma Barranquero
@ 2007-10-22 22:46         ` Jason Rumney
  2007-10-22 23:20           ` Juanma Barranquero
  2007-10-24 11:45           ` Juanma Barranquero
  2007-10-23  4:05         ` Eli Zaretskii
  1 sibling, 2 replies; 13+ messages in thread
From: Jason Rumney @ 2007-10-22 22:46 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Eli Zaretskii, emacs-devel

Juanma Barranquero wrote:
> That's src/s/ms-w32.h, which is included from config.h. Including
> <stdlib.h> before config.h produces this new error:
>
>   w32fns.c:9105: warning: conflicting types for 'w32_abort'
>   w32fns.c:496: warning: previous implicit declaration of 'w32_abort' was here
>
> I'd really like to know why this include shuffling is suddenly needed
> with GCC 4.2.1...
>   

I think the original warning you reported is a new warning.

Try the latest trunk (without any manual changes to include files).

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: "incompatible implicit declaration" warnings with GCC 4.2.1
  2007-10-22 22:46         ` Jason Rumney
@ 2007-10-22 23:20           ` Juanma Barranquero
  2007-10-22 23:27             ` Juanma Barranquero
  2007-10-24 11:45           ` Juanma Barranquero
  1 sibling, 1 reply; 13+ messages in thread
From: Juanma Barranquero @ 2007-10-22 23:20 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Eli Zaretskii, emacs-devel

On 10/23/07, Jason Rumney <jasonr@gnu.org> wrote:

> I think the original warning you reported is a new warning.

Aha.

> Try the latest trunk (without any manual changes to include files).

The `abort' warning has been fixed. The `pow' one is still there (you
haven't included <math.h> in w32fns.c).

             Juanma

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: "incompatible implicit declaration" warnings with GCC 4.2.1
  2007-10-22 23:20           ` Juanma Barranquero
@ 2007-10-22 23:27             ` Juanma Barranquero
  0 siblings, 0 replies; 13+ messages in thread
From: Juanma Barranquero @ 2007-10-22 23:27 UTC (permalink / raw)
  To: Jason Rumney; +Cc: Eli Zaretskii, emacs-devel

On 10/23/07, Juanma Barranquero <lekktu@gmail.com> wrote:

> The `abort' warning has been fixed. The `pow' one is still there (you
> haven't included <math.h> in w32fns.c).

Now it is fixed. Thanks.

             Juanma

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: "incompatible implicit declaration" warnings with GCC 4.2.1
  2007-10-22 21:55       ` Juanma Barranquero
  2007-10-22 22:46         ` Jason Rumney
@ 2007-10-23  4:05         ` Eli Zaretskii
  2007-10-23  8:18           ` Juanma Barranquero
  1 sibling, 1 reply; 13+ messages in thread
From: Eli Zaretskii @ 2007-10-23  4:05 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: emacs-devel, jasonr

> Date: Mon, 22 Oct 2007 23:55:29 +0200
> From: "Juanma Barranquero" <lekktu@gmail.com>
> Cc: "Eli Zaretskii" <eliz@gnu.org>, emacs-devel@gnu.org
> 
> I'd really like to know why this include shuffling is suddenly needed
> with GCC 4.2.1...

Evidently, GCC 4.2.1 now has more functions implemented as built-ins,
among them `pow' and `abort'.  This means that GCC knows their
prototypes even without seeing the header file in which they are
supposed to be declared.  Thus, it can now issue warnings where it
previously couldn't.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: "incompatible implicit declaration" warnings with GCC 4.2.1
  2007-10-23  4:05         ` Eli Zaretskii
@ 2007-10-23  8:18           ` Juanma Barranquero
  0 siblings, 0 replies; 13+ messages in thread
From: Juanma Barranquero @ 2007-10-23  8:18 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On 10/23/07, Eli Zaretskii <eliz@gnu.org> wrote:

> Evidently, GCC 4.2.1 now has more functions implemented as built-ins,
> among them `pow' and `abort'.

OK, I understand. Thanks.

             Juanma

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: "incompatible implicit declaration" warnings with GCC 4.2.1
  2007-10-22 22:46         ` Jason Rumney
  2007-10-22 23:20           ` Juanma Barranquero
@ 2007-10-24 11:45           ` Juanma Barranquero
  2007-10-24 12:41             ` Jason Rumney
  1 sibling, 1 reply; 13+ messages in thread
From: Juanma Barranquero @ 2007-10-24 11:45 UTC (permalink / raw)
  To: Jason Rumney; +Cc: emacs-devel

On 10/23/07, Jason Rumney <jasonr@gnu.org> wrote:

> I think the original warning you reported is a new warning.
>
> Try the latest trunk (without any manual changes to include files).

BTW, the fixes should be backported to EMACS_22_BASE.

             Juanma

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: "incompatible implicit declaration" warnings with GCC 4.2.1
  2007-10-24 11:45           ` Juanma Barranquero
@ 2007-10-24 12:41             ` Jason Rumney
  2007-10-24 12:53               ` Juanma Barranquero
  0 siblings, 1 reply; 13+ messages in thread
From: Jason Rumney @ 2007-10-24 12:41 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: emacs-devel

Juanma Barranquero wrote:
> BTW, the fixes should be backported to EMACS_22_BASE.
>   

They are not fixing a bug, only getting rid of compiler warnings, and
the changes were substantial enough to carry a risk of breaking
something, so I'd rather not.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: "incompatible implicit declaration" warnings with GCC 4.2.1
  2007-10-24 12:41             ` Jason Rumney
@ 2007-10-24 12:53               ` Juanma Barranquero
  0 siblings, 0 replies; 13+ messages in thread
From: Juanma Barranquero @ 2007-10-24 12:53 UTC (permalink / raw)
  To: Jason Rumney; +Cc: emacs-devel

On 10/24/07, Jason Rumney <jasonr@gnu.org> wrote:

> They are not fixing a bug, only getting rid of compiler warnings, and
> the changes were substantial enough to carry a risk of breaking
> something, so I'd rather not.

That's true for the `abort' warning. The one for `pow' can be cured
just by including <math.h>, I think.

             Juanma

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-10-24 12:53 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-22 15:24 "incompatible implicit declaration" warnings with GCC 4.2.1 Juanma Barranquero
2007-10-22 21:08 ` Eli Zaretskii
2007-10-22 21:29   ` Juanma Barranquero
2007-10-22 21:45     ` Jason Rumney
2007-10-22 21:55       ` Juanma Barranquero
2007-10-22 22:46         ` Jason Rumney
2007-10-22 23:20           ` Juanma Barranquero
2007-10-22 23:27             ` Juanma Barranquero
2007-10-24 11:45           ` Juanma Barranquero
2007-10-24 12:41             ` Jason Rumney
2007-10-24 12:53               ` Juanma Barranquero
2007-10-23  4:05         ` Eli Zaretskii
2007-10-23  8:18           ` Juanma Barranquero

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.