core icon indicating copy to clipboard operation
core copied to clipboard

Warnings related to string.h with newest versions of GCC

Open viferga opened this issue 4 years ago • 2 comments

🐛 Bug Report

Recently, related to LLVM Loader, I've seen that there's some warnings with strlen and strncpy which were not present on my version of GCC ( https://github.com/metacall/core/pull/137#issuecomment-840881892 ). This warnings indicate that there can be an out of bounds error or similar, so it should be reviewed.

Expected Behavior

No warnings shown.

Current Behavior

Warnings shown.

Possible Solution

I have not investigated it yet, but we should check the bounds properly.

Steps to Reproduce

Using GCC 9 seems to trigger them.

viferga avatar May 14 '21 08:05 viferga

hey i would like to work on this issue if it is still open?

karnikkanojia avatar Dec 22 '21 19:12 karnikkanojia

Most of these have been solved, but I do not trust them. I think we should add some way to safely handle strings, standardized in the whole project. Something like this: https://github.com/metacall/core/commit/9586750fe1231c30c54b1d936751ee5df763aaee#diff-453f830a73f17cd076f14418fcf1313db6b1eea785b89108dd2536dcee5b5dccR38-R45

viferga avatar Feb 24 '22 15:02 viferga