Thread: ecpg: the comments inside the declare section are not outputted correctly.
ecpg: the comments inside the declare section are not outputted correctly.
From
Ashutosh Sharma
Date:
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,
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,