Hi,
I just tried -b to see whether I forgot to free something, and I found that the memory and bounds checker will alert when I use the memory I mmap'd. While I was writing a demo for report, I found that the checker also reported out of region when I accessed errno. I was to print errno to see if I really opened the file to be mmap'd.
I think the warning for the mmap'd memory is not a problem, just needed to be pointed out in the document. But the errno one is quite strange.
The demo is sent together as an attachment.
Output:
$ tcc 2018-04-06-02-tccmmap.c -b
$ ./a.out
errno demo: 11539
bcheck.c __bound_ptr_indir4: 0x7f3a50abc698 is outside of the region
11539: Signal SIGSEGV (11) received
mmap demo: 11540
mmap demo no read: 11541
bcheck.c __bound_ptr_indir1: 0x7f3a50acf003 is outside of the region
11540: Signal SIGSEGV (11) received
My TCC Version:
$ tcc -v
tcc version 0.9.27 (x86_64 Linux)
By the way, this project is extraordinary great! I use it all the time. It is so wonderful for me to find people like you who remember what good software looks like.
Regards,
George Gaarder