c2v icon indicating copy to clipboard operation
c2v copied to clipboard

Strange error message about binary number with unsuitable digit

Open JalonSolov opened this issue 2 years ago • 1 comments

  1. Download source to sqlite release: https://www.sqlite.org/src/tarball/sqlite.tar.gz?r=release
  2. Extract source.
  3. cd sqlite
  4. v translate tool/sqldiff.c
C to V translator 0.3.1
  translating tool/sqldiff.c  ... tool/sqldiff.v:1145:17: error: this binary number has unsuitable digit `e`
 1143 |         iblock := 0
 1144 |         
 1145 |         bestcnt := 0
      |                     ^
 1146 |         bestofst := 0bestlitsz := 0
 1147 |         hash_init(&h, &zout [base] )

Internal vfmt error while formatting file: tool/sqldiff.v.
Encountered a total of: 1 errors.
 took   347 ms ; output .v file: tool/sqldiff.v
Translated   1 files in   347 ms.

JalonSolov avatar Jul 23 '22 01:07 JalonSolov

Figured it out... the next line starts with be, so V is seeing 0be thinking you meant to start a binary literal, but the e is, indeed, unsuitable for that.

The next line is also badly formatted, with no newline after the first 0.

JalonSolov avatar Jul 24 '22 15:07 JalonSolov