Comment by dapperdrake
1 year ago
SQLite3 just concatenation everything together into one compilation unit. So, more people have been using this than probably know about it.
1 year ago
SQLite3 just concatenation everything together into one compilation unit. So, more people have been using this than probably know about it.
I totally see the point of this, but still, you have to admit this is pretty funny:
> Developers sometimes experience trouble debugging the quarter-million line amalgamation source file because some debuggers are only able to handle source code line numbers less than 32,768 [...] To circumvent this limitation, the amalgamation is also available in a split form, consisting of files "sqlite3-1.c", "sqlite3-2.c", and so forth, where each file is less than 32,768 lines in length
That would imply that such debuggers are storing line numbers as not just 16-bit numbers (which is probably sensible, considering that source files longer than that are uncommon), but as signed 16-bit numbers. I can't fathom a situation where line numbers would ever be negative.
Cue C or C++ should-I-prefer-signed-or-unsigned-integers debate
It's not that uncommon of a convention to strictly use signed numbers unless doing bit manipulation, eg the Google C++ Style Guide.
4 replies →
Maybe somewhere some line offset is stored as i16? (I don't understand why anyway but..)
The __LINE__ macro defaults to "int". That then gets handed to the debugger.
3 replies →
*concatenates
Apologies for the typo. And now it is too late to edit the post.