Skip site navigation (1) Skip section navigation (2)

Re: msvc const warnings

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Magnus Hagander" <magnus(at)hagander(dot)net>, "pgsql-patches" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: msvc const warnings
Date: 2007-07-24 15:24:35
Message-ID: 877iop25ak.fsf@oxford.xeocode.com (view raw or flat)
Thread:
Lists: pgsql-patches
"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> Gregory Stark <stark(at)enterprisedb(dot)com> writes:
>> "Magnus Hagander" <magnus(at)hagander(dot)net> writes:
>>> Stefan mentioned that the warning may be one that shows up in a different
>>> compiler somewhere as well, thouh, which might indicate that we should fix
>>> the underlying issue? (Even if the code is correct, if it confuses multiple
>>> compilers...)
>
>> I think the right fix is just to remove the const qualifier. It's clearly not
>> treating the pointer as const if it's passing it to pfree which is surely a
>> state change if anything is.
>
> That was what you claimed in the previous discussion, but you were wrong
> then and you're still wrong.  The pointer is "const char **" which means
> it is a pointer to some pointers that are not themselves constant. 

Oh, wow. You're right on both counts. I didn't find my own comment on the old
thread before responding. And I didn't notice it was a const char **. That is
a crazy bug.

Can we just disable const checking for MSVCC in general without using the
#pragmas? It clearly doesn't understand how const works making that warning
from it useless.

-- 
  Gregory Stark
  EnterpriseDB          http://www.enterprisedb.com


In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2007-07-24 15:53:05
Subject: Re: plperl warnings on win32
Previous:From: Tom LaneDate: 2007-07-24 15:03:34
Subject: Re: msvc const warnings

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group