Re: ecpg - GRANT bug

Поиск
Список
Период
Сортировка
От Bill Studenmund
Тема Re: ecpg - GRANT bug
Дата
Msg-id Pine.NEB.4.33.0110150506170.22955-100000@vespasia.home-net.internetconnect.net
обсуждение исходный текст
Ответ на Re: ecpg - GRANT bug  (Lee Kindness <lkindness@csl.co.uk>)
Ответы Re: ecpg - GRANT bug  (Lee Kindness <lkindness@csl.co.uk>)
Список 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 по дате отправления:

Предыдущее
От: Bill Studenmund
Дата:
Сообщение: Re: How do I get the current time in seconds in the unix
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why are ftp mirrors out of sync?