[Grbl_Esp32 PR#142] Fix possible reference to uninitialized variables

未分类 bolang 3个月前 (10-14) 39次浏览

Issue #142 | 状态: 已关闭 | 作者: odaki | 创建时间: 2019-05-06


I would like to report on other matters.
In my environment, raising warning levels will result in compilation errors.

(snip)
In file included from /var/folders/tq/mmlh25c96d157qrqgtv3g36w0000gn/T/arduinobuild993650/sketch/grbl.h:36:0,
from /var/folders/tq/mmlh25c96d157qrqgtv3g36w0000gn/T/arduinobuild993650/sketch/config.h:40,
from /var/folders/tq/mmlh25c96d157qrqgtv3g36w0000gn/T/arduinobuild993650/sketch/grbl.h:35,
from /var/folders/tq/mmlh25c96d157qrqgtv3g36w0000gn/T/arduinobuild993650/sketch/gcode.cpp:25:
/var/folders/tq/mmlh25c96d157qrqgtv3g36w0000gn/T/arduinobuild993650/sketch/nutsbolts.h: In function 'uint8t gcexecuteline(char*, uint8_t)':
nutsbolts.h:64:40: error: 'wordbit' may be used uninitialized in this function [-Werror=maybe-uninitialized]
#define bit_istrue(x,mask) ((x & mask) != 0)
^
/var/folders/tq/mmlh25c96d157qrqgtv3g36w0000gn/T/arduinobuild993650/sketch/gcode.cpp:111:10: note: 'word_bit' was declared here
uint8t wordbit; // Bit-value for assigning tracking variables
^
(snip)

I will propose a small code as a solution.
(It seems necessary to check multiple commands for each modal group violation)


评论 (4)

#1 – luc-github 于 2019-05-06

I think we should update travis to check warnings to catch this kind of problem


#2 – odaki 于 2019-05-06

> I think we should update travis to check warnings to catch this kind of problem

I agree with you.
I will add “–pref compiler.warning_level=all” to command line.



#4 – odaki 于 2019-05-06

I’m sorry. I just noticed your guidelines.
I should have made pull requests on the “devt” branch.
I will leave your judgment as to how to handle these requests.

Pull Request Guidelines


原始Issue: https://github.com/bdring/Grbl_Esp32/pull/142

喜欢 (0)