Re: Observed Compilation warning in WIN32 build

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Observed Compilation warning in WIN32 build
Date: 2014-01-28 11:28:35
Message-ID: 20140128112835.GB16206@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-01-28 09:13:15 +0000, Rajeev rastogi wrote:
> I observed below WIN32 compilation warnings in postmaster.c (seems introduced by commit ea9df812d8502fff74e7bc37d61bdc7d66d77a7f "Relax the requirement that all lwlocks be stored in a single array.").
>
> 1>.\src\backend\postmaster\postmaster.c(5625) : warning C4133: '=' : incompatible types - from 'LWLockPadded *' to 'LWLock *'
> 1>.\src\backend\postmaster\postmaster.c(5856) : warning C4133: '=' : incompatible types - from 'LWLock *' to 'LWLockPadded *'
>
> Attached is the patch with the fix.
>
> Thanks and Regards,
> Kumar Rajeev Rastogi
>

> *** a/src/backend/postmaster/postmaster.c
> --- b/src/backend/postmaster/postmaster.c
> ***************
> *** 5622,5628 **** save_backend_variables(BackendParameters *param, Port *port,
> #ifndef HAVE_SPINLOCKS
> param->SpinlockSemaArray = SpinlockSemaArray;
> #endif
> ! param->MainLWLockArray = MainLWLockArray;
> param->ProcStructLock = ProcStructLock;
> param->ProcGlobal = ProcGlobal;
> param->AuxiliaryProcs = AuxiliaryProcs;
> --- 5622,5628 ----
> #ifndef HAVE_SPINLOCKS
> param->SpinlockSemaArray = SpinlockSemaArray;
> #endif
> ! param->MainLWLockArray = (LWLock*)MainLWLockArray;
> param->ProcStructLock = ProcStructLock;
> param->ProcGlobal = ProcGlobal;
> param->AuxiliaryProcs = AuxiliaryProcs;
> ***************
> *** 5853,5859 **** restore_backend_variables(BackendParameters *param, Port *port)
> #ifndef HAVE_SPINLOCKS
> SpinlockSemaArray = param->SpinlockSemaArray;
> #endif
> ! MainLWLockArray = param->MainLWLockArray;
> ProcStructLock = param->ProcStructLock;
> ProcGlobal = param->ProcGlobal;
> AuxiliaryProcs = param->AuxiliaryProcs;
> --- 5853,5859 ----
> #ifndef HAVE_SPINLOCKS
> SpinlockSemaArray = param->SpinlockSemaArray;
> #endif
> ! MainLWLockArray = (LWLockPadded*)param->MainLWLockArray;
> ProcStructLock = param->ProcStructLock;
> ProcGlobal = param->ProcGlobal;
> AuxiliaryProcs = param->AuxiliaryProcs;

This strikes me as the wrong fix, the types in BackendParams should be
changed instead.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-01-28 11:51:03 Re: [PATCH] Use MAP_HUGETLB where supported (v3)
Previous Message Heikki Linnakangas 2014-01-28 11:13:43 Re: Race condition in b-tree page deletion