Обсуждение: BUG #2292: Calling conventions in docs

Поиск
Список
Период
Сортировка

BUG #2292: Calling conventions in docs

От
"Adriaan van Os"
Дата:
The following bug has been logged online:

Bug reference:      2292
Logged by:          Adriaan van Os
Email address:      pgres@microbizz.nl
PostgreSQL version: 8.1
Operating system:   Mac OS X
Description:        Calling conventions  in docs
Details:

Section 32.9.5. Writing Code of the 8.1 docs says:

>>While it may be possible to load functions written in languages other than
C into PostgreSQL, this is usually difficult (when it is possible at all)
because other languages, such as C++, FORTRAN, or Pascal often do not follow
the same calling convention as C. That is, other languages do not pass
argument and return values between functions in the same way<<

This is nonsense. GNU Pascal and GNU C use the same calling conventions. In
fact, they share the same compiler-backend.

Sincerely,

Adriaan van Os
<http://www.microbizz.nl/gpc.html>

Re: BUG #2292: Calling conventions in docs

От
Bruno Wolff III
Дата:
On Wed, Mar 01, 2006 at 13:08:17 +0000,
  Adriaan van Os <pgres@microbizz.nl> wrote:
>
> Section 32.9.5. Writing Code of the 8.1 docs says:
>
> >>While it may be possible to load functions written in languages other than
> C into PostgreSQL, this is usually difficult (when it is possible at all)
> because other languages, such as C++, FORTRAN, or Pascal often do not follow
> the same calling convention as C. That is, other languages do not pass
> argument and return values between functions in the same way<<
>
> This is nonsense. GNU Pascal and GNU C use the same calling conventions. In
> fact, they share the same compiler-backend.

You seem to be assuming that Postgres will always be built using gcc. That
isn't the case.

Re: BUG #2292: Calling conventions in docs

От
Adriaan van Os
Дата:
Bruno Wolff III wrote:

>   Adriaan van Os <pgres@microbizz.nl> wrote:
>>
>> Section 32.9.5. Writing Code of the 8.1 docs says:
>>
>>>> While it may be possible to load functions written in languages
>>>> other than
>> C into PostgreSQL, this is usually difficult (when it is possible at
>> all)
>> because other languages, such as C++, FORTRAN, or Pascal often do not
>> follow
>> the same calling convention as C. That is, other languages do not pass
>> argument and return values between functions in the same way<<
>>
>> This is nonsense. GNU Pascal and GNU C use the same calling
>> conventions. In
>> fact, they share the same compiler-backend.
>
> You seem to be assuming that Postgres will always be built using gcc.
> That
> isn't the case.

Note that the manual says "this is usually difficult (when it is
possible at all)". I don't think there are much C compilers around with
calling conventions that a Pascal compiler cannot reproduce. Name me
one ! Anyway, recompiling with gcc will solve the problem.

The manual is simply taking an old prejudice as a fact.

Sincerely,

Adriaan van Os

Re: BUG #2292: Calling conventions in docs

От
Tom Lane
Дата:
Adriaan van Os <pgres@microbizz.nl> writes:
> The manual is simply taking an old prejudice as a fact.

No, it is stating a fact as as fact.  The existence of one
counterexample does not disprove the generalization.

            regards, tom lane

Re: BUG #2292: Calling conventions in docs

От
Adriaan van Os
Дата:
Tom Lane wrote:

> Adriaan van Os <pgres@microbizz.nl> writes:
>> The manual is simply taking an old prejudice as a fact.
>
> No, it is stating a fact as as fact.  The existence of one
> counterexample does not disprove the generalization.

Keep dreaming. Ignorance rules the world.

Adriaan van Os

Re: BUG #2292: Calling conventions in docs

От
Stephan Szabo
Дата:
On Thu, 2 Mar 2006, Adriaan van Os wrote:

> Tom Lane wrote:
>
> > Adriaan van Os <pgres@microbizz.nl> writes:
> >> The manual is simply taking an old prejudice as a fact.
> >
> > No, it is stating a fact as as fact.  The existence of one
> > counterexample does not disprove the generalization.
>
> Keep dreaming. Ignorance rules the world.

Is your claim that over a signifcant fraction of all such products, the
default setting is such that it would just work (without for example
annotating the function in any way - which is basically a significant
enough barrier to be difficult for many users)? That's what would be
necessary to say that it isn't "often difficult". If the claim is that
this one product makes it easy, that's insufficient to disprove "often
difficult" although we could potentially note things that would make it
easier.