Home Forums GAMES在线课程(现代计算机图形学入门)讨论区 作业5:x,y的理解和报错outside the range of type ‘char’5 Reply To: 作业5:x,y的理解和报错outside the range of type ‘char’5

#12145 Score: 1
aparaburu
Participant
1 pt

这个只是颜色值显式转换为char类型的过程中越界被sanitizer发现, 不影响实际写入文件的值和最后的结果.

可以通过修改 CMakeLists.txt 的 target_compile_optionstarget_link_libraries 部分去除 -fsanitize=undefined 以隐藏报错, 或者可以把代码中的 char 修改为 unsigned char, 但是都没必要.

This post has received 1 vote up.
  • This reply was modified 1 year, 11 months ago by aparaburu.