Re: PostgreSQL C Language Extension with C++ Code - Mailing list pgsql-general

From Tom Lane
Subject Re: PostgreSQL C Language Extension with C++ Code
Date
Msg-id 1607.1534101134@sss.pgh.pa.us
Whole thread Raw
In response to Re: PostgreSQL C Language Extension with C++ Code  (TalGloz <glozmantal@gmail.com>)
Responses Re: PostgreSQL C Language Extension with C++ Code
Re: PostgreSQL C Language Extension with C++ Code
List pgsql-general
TalGloz <glozmantal@gmail.com> writes:
> But now my compiler throws some other errors when running make:

> myfunc.cpp:29:10: error: conflicting declaration of C function ‘int64_t
> sum_of_numbers()’
>   int64_t sum_of_numbers(){
>           ^~~~~~~~~~~~~~

Well, yeah, you forgot to repeat the argument list here.  For that
matter, spelling Datum as int64_t is a recipe for trouble, even if
it works on some particular platform.  Should be

Datum sum_of_numbers(PG_FUNCTION_ARGS) { ...

> Why is it so hard to use C++ with PostgerSQL for a C extension? :)

Probably because you've failed to break your bad C++ habits.

            regards, tom lane


pgsql-general by date:

Previous
From: "Phil Endecott"
Date:
Subject: Re: Replication failure, slave requesting old segments
Next
From: "Phil Endecott"
Date:
Subject: Re: Replication failure, slave requesting old segments