FiniteSingularity / obs-stroke-glow-shadow

An OBS plugin to provide efficient Stroke, Glow, and Shadow effects on masked sources.
GNU General Public License v2.0
96 stars 7 forks source link

Fix GCC warning about stringop-overflow #29

Open dnaka91 opened 8 months ago

dnaka91 commented 8 months ago

When building with GCC, a warning is raised about string operation overflow for the usages of strncat. This doesn't happen by default, but when building on Arch Linux system, the makepkg default configuration enables certain extra warnings.

After some searching it seems that GCC warns about it because calling strncat with the source string length as 3rd argument is essentially the same as calling the simpler strcat function.

FiniteSingularity commented 8 months ago

Sorry this has sat in the queue for a while. The original reason I went with strncat instead of strcat is because it was trigging a bunch of warnings in one of the other builds. Once I get home (currently traveling) I'll dive deeper into this, and refresh in my mind why I used strncat in the first place, and see if there is a way to get rid of warnings both in the Arch packaging, and in the other compilers.

dnaka91 commented 6 months ago

Sorry late reply from my side too :sweat_smile:. Just wanted to let you know that it's not high prio, because I can simply suppress that warning for the Arch packaging script.

Also, I can't really test this out on Windows, so won't know if this creates issues on other platforms. At least the CI completed without warnings so far.