A couple more PostgreSQL C questions - Mailing list pgsql-general

From Ron Peterson
Subject A couple more PostgreSQL C questions
Date
Msg-id 20061108005052.GD9684@yellowbank.com
Whole thread Raw
Responses Re: A couple more PostgreSQL C questions
Re: A couple more PostgreSQL C questions
List 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/

pgsql-general by date:

Previous
From: Ron Mayer
Date:
Subject: Re: Stable sort?
Next
From: Ron Peterson
Date:
Subject: Re: A couple more PostgreSQL C questions