Re: TDS_INT8_MIN determined by shifting a negative value

Frediano Ziglio <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <CAHt6W4e7qwrV4nx0TxBqUj+cEBxh2gmTzL-RCb4Dpq4M0Af4Ow@mail.gmail.com>
2016-05-18 21:49 GMT+01:00 John Kendall <[email protected]>:
> Is there another way to determine TDS_INT8_MIN in convert.c (line 96)?
>
> The new llvm compiler on OS X 10.11 is complaining about bit shifting a negative:
>
>    warning: shifting a negative signed value is undefined [-Wshift-negative-value]
>
> John
>

I would go for something like

#define TDS_INT8_MIN  (-((TDS_INT8)1)<<62)-((TDS_INT8)1)<<62))

Frediano
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.