A couple more PostgreSQL C questions

From: Ron Peterson <ron(dot)peterson(at)yellowbank(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: A couple more PostgreSQL C questions
Date: 2006-11-08 00:50:52
Message-ID: 20061108005052.GD9684@yellowbank.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a couple of more PostgreSQL C questions, about the following two
compiler warnings:

____________________________________________________
warning: ISO C90 forbids mixed declarations and code

This appears to be caused by the following statement:

text* rand_dev = PG_GETARG_TEXT_P(0);

in the following context

PG_FUNCTION_INFO_V1( y_somefunc );
Datum
y_somefunc ( PG_FUNCTION_ARGS )
{
if( PG_ARGISNULL(0) ||
PG_ARGISNULL(1) ||
PG_ARGISNULL(2) )
{
PG_RETURN_NULL();
}
text* rand_dev = PG_GETARG_TEXT_P(0);
...

Should I be concerned by this? What's the proper way to code this?

_________________________________________________________________________________
warning: passing argument 3 of 'GetAttributeByNum' from incompatible pointer type

...caused by the following:

bool isNull;
...
n = GetAttributeByNum( tup, 0, &isNull );

executor.h has:

/*
* prototypes from functions in execQual.c
*/
extern Datum GetAttributeByNum(HeapTupleHeader tuple, AttrNumber attrno,
bool *isNull);

I'm just not seeing what's wrong here...

--
Ron Peterson
https://www.yellowbank.com/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael McCloskey 2006-11-08 01:14:44 postgres at startup
Previous Message Ron Mayer 2006-11-08 00:43:49 Re: Stable sort?