◐ Shell
clean mode source ↗

Fix hang on UTF-16 LE BOM file by chrchr-github · Pull Request #636 · cppcheck-opensource/simplecpp

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Merged

danmar

merged 12 commits into

May 27, 2026

Conversation

@chrchr-github chrchr-github changed the title Fix hang on UTF- 16 LE BOM file Fix hang on UTF-16 LE BOM file

Mar 27, 2026

@firewave

Yeah - there's several places which lack checks for EOF. I have WIP tests for that and other corner cases/gaps somewhere - something to be done in preparation of #566.

@firewave

With #647 it should be possible to write a test which uses the input in question.

@chrchr-github

With #647 it should be possible to write a test which uses the input in question.

Can we just run the tests with all three options?

@firewave

Can we just run the tests with all three options?

Yes, if somebody adds the functionality. It didn't seem straight forward to me so I haven't yet. Feel free to do so.

@firewave

I think I took a wrong turn. That should trigger with regular unit test. So please add a test for it.

@firewave

I think I took a wrong turn. That should trigger with regular unit test. So please add a test for it.

Ah - you mentioned FileStream in the ticket. Still I think we should have a unit test (if missing).

@chrchr-github

So there is also some kind of platform divergence going on...

@chrchr-github

@chrchr-github

So there is also some kind of platform divergence going on...

Of course f.write("\xFF\xFE\x3B\x00") does something different on Linux, because why wouldn't it?

~$ hexdump pytest.cpp 
0000000 bfc3 bec3 003b                         
0000006

@danmar

I guess CI will be fixed by #641

danmar

danmar

danmar

@danmar

@chrchr-github I want to release simplecpp so we can update cppcheck repo before the release. do you want to merge now to get this into the release or rather wait?

@danmar

I have approved it, as far as I see it can be merged into the release.

@chrchr-github

@chrchr-github I want to release simplecpp so we can update cppcheck repo before the release. do you want to merge now to get this into the release or rather wait?

It's also a hang in cppcheck, so we might as well merge it (I don't have permission though).