public inbox for [email protected]  
help / color / mirror / Atom feed
From: Ashutosh Sharma <[email protected]>
To: [email protected]
Subject: ecpg: the comments inside the declare section are not outputted correctly.
Date: Mon, 31 Aug 2020 18:23:51 +0530
Message-ID: <CAE9k0Pm-N4eFidk9Mg_ZhdLzGhPRth4K+Zgaigo44EsLX276Jg@mail.gmail.com> (raw)

Hi All,

While working on some other issue, I noticed that the comments inside the
declare section are not outputted correctly. Have a look at the below
example and its output.

void main(void)
{
exec sql begin declare section;
    int v1 = 100;
/* First Layer */
#ifdef MACRO1
/* Second Layer */
#ifdef MACRO2
   int testVar = 2;
#endif
#endif
exec sql end declare section;

    return 1;
}

*Output:*

void main(void)
{
/* exec sql begin declare section */

/* First Layer *//* Second Layer */
#line 4 "test.pgc"
 int v1 = 100 ;

#ifdef MACRO1

#ifdef MACRO2

#line 9 "test.pgc"
 int testVar = 2 ;

#endif
 #endif
/* exec sql end declare section */
#line 12 "test.pgc"


    return 1;
}

If you see the output, the comments present inside the input file got
shifted to the wrong place in the output file. This doesn't happen if such
comments are present outside the declare section.

I know this is not a severe issue but certainly something that would be
nice correcting.

Thanks,

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


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: ecpg: the comments inside the declare section are not outputted correctly.
  In-Reply-To: <CAE9k0Pm-N4eFidk9Mg_ZhdLzGhPRth4K+Zgaigo44EsLX276Jg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox