??? 01/09/07 15:10 Read: times |
#130509 - The warning you propose would be 'wrong' in some c Responding to: ???'s previous message |
Erik Malund said:
I can not count the number of cases where I have found someone else's bug buy removing his "warning suppression". I don't understand why did you mention this. I am proposing a new warning, not suppression of an existing warning. The warning you propose would be 'wrong' in some cases, i.e. you have a large piece of code that run with interrupts disabled (YES, I have seen that being correct, albeit rarely) and the 'automatic' feature disables once more and even worse, may enable after the critical is done. In such a case, you would not react to the warning and thus, in the final compile have a warning, that, in my book, is a NoNo. I said: I believe automatic interrupt disable/enable (or any other mechanism) around manipulation of a variable flagged critical (manually, by the user) may be beneficial. Erik Malund said: No, anything 'hidden' is very detrimental for two reasons: 1) you do not know it is there and thus, if it being there is a problem, you will spend ages hunting the problem. 2) you believe it is there and spend ages hunting the problem that, in this particular case, it is not. There is nothing hidden in doing this. Oh, yes there is. You will not ever know when the compiler (fail to) disable and reenable the interrupts. Erik |