Re: ecpg - GRANT bug - Mailing list pgsql-hackers

From Bill Studenmund
Subject Re: ecpg - GRANT bug
Date
Msg-id Pine.NEB.4.33.0110150506170.22955-100000@vespasia.home-net.internetconnect.net
Whole thread Raw
In response to Re: ecpg - GRANT bug  (Lee Kindness <lkindness@csl.co.uk>)
Responses Re: ecpg - GRANT bug
List pgsql-hackers
On Tue, 16 Oct 2001, Lee Kindness wrote:

> And the patch below corrects a pet peeve I have with ecpg, all errors
> and warnings are output with a line number one less than reality...

I think this patch is wrong. Wouldn't it be better to make the line number
in yylineno be correct? Also, there are users of the line number in pcg.l
which you didn't change.

Looking at it, I don't see why the line number is off. It is initialized
to 1 at the begining and whenever a new file is included. In the generated
code, it is incrimented whenever a '\n' is found. Strange...

Take care,

Bill

> Lee.
>
> *** ./interfaces/ecpg/preproc/preproc.y.orig    Tue Oct 16 10:19:27 2001
> --- ./interfaces/ecpg/preproc/preproc.y    Tue Oct 16 10:19:49 2001
> ***************
> *** 36,49 ****
>       switch(type)
>       {
>       case ET_NOTICE:
> !         fprintf(stderr, "%s:%d: WARNING: %s\n", input_filename, yylineno, error);
>           break;
>       case ET_ERROR:
> !         fprintf(stderr, "%s:%d: ERROR: %s\n", input_filename, yylineno, error);
>           ret_value = PARSE_ERROR;
>           break;
>       case ET_FATAL:
> !         fprintf(stderr, "%s:%d: ERROR: %s\n", input_filename, yylineno, error);
>           exit(PARSE_ERROR);
>       }
>   }
> --- 36,52 ----
>       switch(type)
>       {
>       case ET_NOTICE:
> !         fprintf(stderr, "%s:%d: WARNING: %s\n", input_filename,
> !             yylineno + 1, error);
>           break;
>       case ET_ERROR:
> !         fprintf(stderr, "%s:%d: ERROR: %s\n", input_filename,
> !             yylineno + 1, error);
>           ret_value = PARSE_ERROR;
>           break;
>       case ET_FATAL:
> !         fprintf(stderr, "%s:%d: ERROR: %s\n", input_filename,
> !             yylineno + 1, error);
>           exit(PARSE_ERROR);
>       }
>   }
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>



pgsql-hackers by date:

Previous
From: Bill Studenmund
Date:
Subject: Re: How do I get the current time in seconds in the unix
Next
From: Tom Lane
Date:
Subject: Re: Why are ftp mirrors out of sync?