cpu/saml21: Fix possibly uninitialized variable in pm.c.#9244
cpu/saml21: Fix possibly uninitialized variable in pm.c.#9244jia200x merged 1 commit intoRIOT-OS:masterfrom
Conversation
|
Also, would it be a good idea to enable |
|
Just wondering : Can't we just replace |
|
@josephnoir any advise here? |
|
@dylad I think that having Makes it clear that "2" is an expected value, and that for other values we do the same as if the value was 2. Of course, if "case 2:" is omitted, the program is perfectly equivalent, but in my opinion less clear. |
|
Sure ! I was just wondering. |
|
@dylad Done. |
|
Murdock is green. |
|
Should I rebase? |
|
@jcarrano yup. And then we merge |
1de1397 to
da85094
Compare
What is the correct place to discuss such a proposal? |
|
@jcarrano either a GH issue or devel list |
|
Murdock green and go |
|
@jcarrano Create a new PR for it. It sounds like a good idea to enable that warning for all platforms which support it. |
|
Murdock green -> GO |
Contribution description
The code in pm.c for saml32 was missing a
defaultcase, this triggered a-Wmaybe-unititialized.-Wmaybe-unititializedwarnings are somewhat unreliable (see this answer). Depending on optimization options, sometimes the compiler is able to detect it (sometimes it gives a false positive). Would it be a good idea to turn this warning back into a warning to avoid having unpredictable compilation errors?