#include <stdlib.h> present twice in define.pgc

Lists: Postg토토 결과SQL : Postg토토
From: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Cc: Michael Meskes <meskes(at)postgresql(dot)org>
Subject: #include <stdlib.h> present twice in define.pgc
Date: 2020-09-07 13:47:58
Message-ID: CAE9k0PkORqHHGKY54-sFyDpP90yAf+05Auc4fs9EAn4J+uBeUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: Postg토토 결과SQL : Postg토토

Hi All,

I could see that the #include <stdlib.h> statement is present twice in the
define.pgc test file. See below:

[ashu(at)localhost postgresql]$ head
src/interfaces/ecpg/test/preproc/define.pgc
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>

exec sql include ../regression;

...
...

Should we consider removing one of them?

I know that there won't be multiple inclusion of the same header file
because of #ifndef and #define pre-processor directives which defines
_STDLIB_H macro that allows the file to included just once, but I still
feel that it is better to avoid having such things. It doesn't do any harm
but is certainly not required. Thoughts?

--
With Regards,
Ashutosh Sharma
EnterpriseDB:http://www.enterprisedb.com


From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, pgsql-interfaces(at)postgresql(dot)org
Cc: Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Re: #include <stdlib.h> present twice in define.pgc
Date: 2021-01-25 08:16:12
Message-ID: 07feb633-343d-d550-722c-0acc81269020@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-interfaces

On 2020-09-07 15:47, Ashutosh Sharma wrote:
> I could see that the #include <stdlib.h> statement is present twice in
> the define.pgc test file. See below:
>
> [ashu(at)localhost postgresql]$ head
> src/interfaces/ecpg/test/preproc/define.pgc
> #include <stdlib.h>
> #include <string.h>
> #include <stdlib.h>
> #include <stdio.h>

fixed


From: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: "pgsql-interfaces(at)postgresql(dot)org" <pgsql-interfaces(at)postgresql(dot)org>, Michael Meskes <meskes(at)postgresql(dot)org>
Subject: Re: #include <stdlib.h> present twice in define.pgc
Date: 2021-01-25 11:50:51
Message-ID: CAE9k0PkBQFvrHkn2zj-mWkpc9cgejXiJKK3V_HHc5sNCm3Bxig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-interfaces

thanks.!

On Monday, January 25, 2021, Peter Eisentraut <
peter(dot)eisentraut(at)enterprisedb(dot)com> wrote:

> On 2020-09-07 15:47, Ashutosh Sharma wrote:
>
>> I could see that the #include <stdlib.h> statement is present twice in
>> the define.pgc test file. See below:
>>
>> [ashu(at)localhost postgresql]$ head src/interfaces/ecpg/test/prepr
>> oc/define.pgc
>> #include <stdlib.h>
>> #include <string.h>
>> #include <stdlib.h>
>> #include <stdio.h>
>>
>
> fixed
>