Re: Rejection of the smallest int8 - Mailing list pgsql-patches

From Tom Lane
Subject Re: Rejection of the smallest int8
Date
Msg-id 19439.1006365271@sss.pgh.pa.us
Whole thread Raw
In response to Re: Rejection of the smallest int8  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Rejection of the smallest int8  (sugita@sra.co.jp)
List pgsql-patches
I said:
> If you can see a way around that, we're all ears ...

Of course there's always the brute-force solution:

    if (strcmp(ptr, "-9223372036854775808") == 0)
       return -9223372036854775808;
    else
       <<proceed with int8in>>

(modulo some #ifdef hacking to attach the correct L or LL suffix to the
constant, but you get the idea)

This qualifies as pretty durn ugly, but might indeed be more portable
than any other alternative.  Comments?

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Rejection of the smallest int8
Next
From: Tom Lane
Date:
Subject: Re: Rejection of the smallest int8