Re: Code not compiling since 19d5486 due to concatenate operators in macros

From: Hiroshi Inoue <inoue(at)tpf(dot)co(dot)jp>
To: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: Code not compiling since 19d5486 due to concatenate operators in macros
Date: 2013-10-29 01:10:05
Message-ID: 526F0AED.9010601@tpf.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

(2013/10/28 19:53), Heikki Linnakangas wrote:
> On 28.10.2013 10:10, Michael Paquier wrote:
>> Hi all,
>> (resending patch as it looks that it was stuck in administration queue
>> of this ML...)
>>
>> I noticed this morning that ODBC does not compile correctly since
>> commit 19d5486 due to some macros using concatenate operators used
>> with CORR_STRCPY and CORR_VALCPY in psqlodbc.c and connection.c.
>>
>> In the case of CORR_VALCPY the macro simply needs to copy a field one
>> by one, and for CORR_STRCPY only a string is copied, so concatenate
>> operators are not necessary IMO. Please find a patch fixing that by
>> removing the unnecessary operators.
>
> Thanks, committed to fix the build.
>
> Hiroshi, I didn't understand the point of that change in the first
> place. The old memcpy method of copying these objects seemed fine to me.
> Can you elaborate?

password member of ConnInfo struct was changed to be of pgNAME type.
pgNAME type essetially means a pointer. It's dangerous to simply
copy a pointer to another one and I forgot the operation needed for
password member of pgNAME type and it caused a double free crash later.
I dislike the double free bug and changed CC_copy_conninfo to copy each
item one by one for future changes.

> PS. I just noticed that the email address in your git commit messages is
> misspelled, "inoue(at)tpf(dot)co(dot)p". Check your .gitconfig file.

Oops you are right.
Thanks.

regards,
Hiroshi Inoue

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Christoph Berg 2013-11-01 22:39:54 src/test/dataatexecution-test.c: VOID undeclared
Previous Message Heikki Linnakangas 2013-10-28 10:53:33 Re: Code not compiling since 19d5486 due to concatenate operators in macros