Re: Suppress warnings on mingw - Mailing list pgsql-patches

From Magnus Hagander
Subject Re: Suppress warnings on mingw
Date
Msg-id 20070418083251.GD20431@svr2.hagander.net
Whole thread Raw
In response to Suppress warnings on mingw  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: Suppress warnings on mingw  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
List pgsql-patches
On Mon, Apr 16, 2007 at 12:32:56PM +0900, ITAGAKI Takahiro wrote:
> This trivial patch fixes the following warnings on mingw.
>
> ----
> pthread-win32.c:20: warning: no previous prototype for 'pthread_self'

> Index: src/bin/pgevent/pgevent.def
> ===================================================================
> --- src/bin/pgevent/pgevent.def    (HEAD)
> +++ src/bin/pgevent/pgevent.def    (working copy)
> @@ -1,4 +1,4 @@
>  ; dlltool --output-def pgevent.def pgevent.o pgmsgevent.o
>  EXPORTS
> -    DllUnregisterServer ;
> -    DllRegisterServer ;
> +    DllUnregisterServer = DllUnregisterServer@0 ;
> +    DllRegisterServer = DllRegisterServer@0 ;

This breaks the MSVC build, so not applied. Are you sure we should not just
follow the instructions given in the error msg?

pgevent.exp : error LNK2001: unresolved external symbol DllRegisterServer@0
.\Debug\pgevent\pgevent.dll : fatal error LNK1120: 1 unresolved externals


> Index: src/port/pthread-win32.h
> ===================================================================
> --- src/port/pthread-win32.h    (HEAD)
> +++ src/port/pthread-win32.h    (working copy)
> @@ -5,7 +5,7 @@
>  typedef HANDLE pthread_mutex_t;
>  typedef int pthread_once_t;
>
> -DWORD        pthread_self();
> +DWORD        pthread_self(void);
>
>  void        pthread_setspecific(pthread_key_t, void *);
>  void       *pthread_getspecific(pthread_key_t);
>
I've applied the fix for this. I also updated the C file, since with your
patch the C and the H file had different things. If there was a reason you
didn't update the C file, let me know and I'll revert that part.


//Magnus

pgsql-patches by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: log_autovacuum
Next
From: ITAGAKI Takahiro
Date:
Subject: Re: Suppress warnings on mingw