okbob / pspg

Unix pager (with very rich functionality) designed for work with tables. Designed for PostgreSQL, but MySQL is supported too. Works well with pgcli too. Can be used as CSV or TSV viewer too. It supports searching, selecting rows, columns, or block and export selected area to clipboard.
BSD 2-Clause "Simplified" License
2.43k stars 85 forks source link

warning: integer overflow in expression of type ‘long int’ results in ‘0’ #231

Closed df7cb closed 1 year ago

df7cb commented 1 year ago

This warning on i386 (32-bit) Debian looks relevant:

16:02:22 src/table.c: In function ‘cut_numeric_value’:
16:02:22 src/table.c:1788:30: warning: integer overflow in expression of type ‘long int’ results in ‘0’ [-Woverflow]
16:02:22      mp = 1024l * 1024 * 1024 * 1024;
16:02:22                               ^
16:02:22 src/table.c:1800:30: warning: integer overflow in expression of type ‘long int’ results in ‘0’ [-Woverflow]
16:02:22      mp = 1024l * 1024 * 1024 * 1024;
16:02:22                               ^

sizeof(long) is only 4 bytes on 32-bit architectures.

okbob commented 1 year ago

should be fixed by e71e48fb6370ec3562cefa69685ccf30d4711cde, please check

okbob commented 1 year ago

fixed in 5.8.0