IAR uses the '@' symbol to specify the absolute address of data values (e.g. hardware registers). Anyone found a way to configure cppcheck to accept this construct. Here's a sample code snippet.
If you have some time then feel free to look at how this can be solved in Cppcheck.
I guess that it is ok to remove "@SOMEADDR" in such variable declarations. That can be done in our lib/tokenizer.cpp somewhere in Tokenizer::simplifyTokenList1().
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the ticket, amai provided links to a workaround. Rather than using the @ address notation, #pragma location= serves the same purpose and cppcheck is perfectly happy with it.
Last edit: Mark Dee 2018-05-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
IIRC it is not IAR specific. I have seen this with the original ARM compiler too. It was at some place (i think a header file) where i can not or do not want to simply change it. So IMHO it would be nice if Cppcheck could handle this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
IAR uses the '@' symbol to specify the absolute address of data values (e.g. hardware registers). Anyone found a way to configure cppcheck to accept this construct. Here's a sample code snippet.
__no_init static AT91S_DBGU s_Debug @ DEBUG_REG_ADDR;
Thanks.
As far as I see you can't fix this by some configuration.
I created this ticket:
https://trac.cppcheck.net/ticket/8572
If you have some time then feel free to look at how this can be solved in Cppcheck.
I guess that it is ok to remove "@SOMEADDR" in such variable declarations. That can be done in our lib/tokenizer.cpp somewhere in
Tokenizer::simplifyTokenList1()
.In the ticket, amai provided links to a workaround. Rather than using the
@ address
notation,#pragma location=
serves the same purpose and cppcheck is perfectly happy with it.Last edit: Mark Dee 2018-05-14
IIRC it is not IAR specific. I have seen this with the original ARM compiler too. It was at some place (i think a header file) where i can not or do not want to simply change it. So IMHO it would be nice if Cppcheck could handle this.
For information, this was fixed in Cppcheck-1.86. No workaround with pragma is needed.
not quite fully fixed. As seen from the following link:
https://sourceforge.net/p/cppcheck/discussion/general/thread/8f618cb0a3/
for case of array of variable at absolute address.
Calvin