Compiler warnings fix

Lists: pgsql-hackers
From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Compiler warnings fix
Date: 2009-01-26 04:14:00
Message-ID: 20090126125415.8F2B.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Here is a patch to surpress compiler warnings in pg_locale.c and pg_regress.c.

There are following warnings if nls is enabled:
pg_locale.c: In function `pg_perm_setlocale':
pg_locale.c:161: warning: assignment discards qualifiers from pointer target type
and if nls is disabled:
pg_locale.c:615: warning: 'IsoLocaleName' defined but not used

There is also a warning in pg_regress.c:
pg_regress.c: In function `wait_for_tests':
pg_regress.c:1367: warning: passing arg 2 of `GetExitCodeProcess' from incompatible pointer type

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center

Attachment Content-Type Size
fix_warnings.patch application/octet-stream 1.4 KB

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Compiler warnings fix
Date: 2009-01-26 13:01:48
Message-ID: 497DB43C.2090205@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

ITAGAKI Takahiro wrote:
> Here is a patch to surpress compiler warnings in pg_locale.c and pg_regress.c.
>
> There are following warnings if nls is enabled:
> pg_locale.c: In function `pg_perm_setlocale':
> pg_locale.c:161: warning: assignment discards qualifiers from pointer target type
> and if nls is disabled:
> pg_locale.c:615: warning: 'IsoLocaleName' defined but not used
>
> There is also a warning in pg_regress.c:
> pg_regress.c: In function `wait_for_tests':
> pg_regress.c:1367: warning: passing arg 2 of `GetExitCodeProcess' from incompatible pointer type

Which platform, which compiler, what configure options?


From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Compiler warnings fix
Date: 2009-01-27 00:50:28
Message-ID: 20090127094848.8F7D.52131E4D@oss.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:

> ITAGAKI Takahiro wrote:
> > Here is a patch to surpress compiler warnings in pg_locale.c and pg_regress.c.
> >
> > There are following warnings if nls is enabled:
> > pg_locale.c: In function `pg_perm_setlocale':
> > pg_locale.c:161: warning: assignment discards qualifiers from pointer target type
> > and if nls is disabled:
> > pg_locale.c:615: warning: 'IsoLocaleName' defined but not used
> >
> > There is also a warning in pg_regress.c:
> > pg_regress.c: In function `wait_for_tests':
> > pg_regress.c:1367: warning: passing arg 2 of `GetExitCodeProcess' from incompatible pointer type
>
> Which platform, which compiler, what configure options?

It is in mingw, gcc.exe (GCC) 3.4.5 (mingw-vista special r3).

There are same warning on vaquita in buildfarm.
http://www.pgbuildfarm.org/cgi-bin/show_stage_log.pl?nm=vaquita&dt=2009-01-26%20210011&stg=make

Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Compiler warnings fix
Date: 2009-01-27 03:14:15
Message-ID: 497E7C07.1090009@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

ITAGAKI Takahiro wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
>
>
>> ITAGAKI Takahiro wrote:
>>
>>> Here is a patch to surpress compiler warnings in pg_locale.c and pg_regress.c.
>>>
>>> There are following warnings if nls is enabled:
>>> pg_locale.c: In function `pg_perm_setlocale':
>>> pg_locale.c:161: warning: assignment discards qualifiers from pointer target type
>>> and if nls is disabled:
>>> pg_locale.c:615: warning: 'IsoLocaleName' defined but not used
>>>
>>> There is also a warning in pg_regress.c:
>>> pg_regress.c: In function `wait_for_tests':
>>> pg_regress.c:1367: warning: passing arg 2 of `GetExitCodeProcess' from incompatible pointer type
>>>
>> Which platform, which compiler, what configure options?
>>
>
> It is in mingw, gcc.exe (GCC) 3.4.5 (mingw-vista special r3).
>
> There are same warning on vaquita in buildfarm.
> http://www.pgbuildfarm.org/cgi-bin/show_stage_log.pl?nm=vaquita&dt=2009-01-26%20210011&stg=make
>
>
>

Wouldn't we be better off using defined(ENABLE_NLS) instead of
defined(LC_MESSAGES) ?

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Compiler warnings fix
Date: 2009-01-27 04:14:56
Message-ID: 5673.1233029696@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>> There are same warning on vaquita in buildfarm.
>> http://www.pgbuildfarm.org/cgi-bin/show_stage_log.pl?nm=vaquita&dt=2009-01-26%20210011&stg=make

> Wouldn't we be better off using defined(ENABLE_NLS) instead of
> defined(LC_MESSAGES) ?

No, because the purpose of that #if is to prevent choking on the
references to LC_MESSAGES if it's not defined. Whether ENABLE_NLS
is defined is 100% orthogonal to that.

Given the current usage it seems that the only way to avoid the
"'IsoLocaleName' defined but not used" warning is to compile it
conditionally on LC_MESSAGES as well as WIN32. I agree that's
kind of ugly, but that's what the usage is.

regards, tom lane


From: Magnus Hagander <magnus(at)hagander(dot)net>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Compiler warnings fix
Date: 2009-01-27 12:47:29
Message-ID: 497F0261.6030101@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

ITAGAKI Takahiro wrote:
> Here is a patch to surpress compiler warnings in pg_locale.c and pg_regress.c.
>
> There are following warnings if nls is enabled:
> pg_locale.c: In function `pg_perm_setlocale':
> pg_locale.c:161: warning: assignment discards qualifiers from pointer target type
> and if nls is disabled:
> pg_locale.c:615: warning: 'IsoLocaleName' defined but not used
>
> There is also a warning in pg_regress.c:
> pg_regress.c: In function `wait_for_tests':
> pg_regress.c:1367: warning: passing arg 2 of `GetExitCodeProcess' from incompatible pointer type

Applied (as two separate patches since I missed that there were two
files initially).

I agree with other comments that #ifdef:ing on LC_MESSAGES may not be
the greatest-looking solution, but the code that calls it is ifdef:ed
that way, so mimicking that seems like the right thing to do at this time.

//Magnus