11.07.2015 Views

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ICCV8 <strong>for</strong> AVR – C Compiler <strong>for</strong> Atmel AVR!W (10):[warning] [MISRA 1512]suspicious array-to-pointer decay in <strong>the</strong> leftoper<strong>and</strong> of `->'An implicit array-to-pointer decay in <strong>the</strong> left oper<strong>and</strong> of <strong>the</strong> -> member accessoperator is considered suspicious. For example:struct S {int i;} a[5];int f(void){return a -> i; // WARNING: <strong>the</strong> index is not specified}The warning can be suppressed by specifying <strong>the</strong> index of <strong>the</strong> dereferencing arrayelement explicitly:int f(void){return a[0].i; // OK}!W (8):[warning] [MISRA 1515]assignment used as conditional expression!W (11):[warning] [MISRA 2350]assignment in conditional expressionAssignment operators used within control expressions of <strong>the</strong> conditional <strong>and</strong> loopoperators are considiered suspicuous, e.g.:if(i = j) ... // WARNINGNote that <strong>the</strong> use of compound assignments in <strong>the</strong>se contexts results in <strong>the</strong> same:if(i += j) ... // WARNINGAlso, note that <strong>the</strong> increment <strong>and</strong> decrement operators are not considered to beassignments in <strong>the</strong>se contexts:if(i++) ... // OK: not an assignmentThe warning can be suppressed by surrounding <strong>the</strong> assignment expression with <strong>the</strong>paren<strong>the</strong>ses:if((i = j)) ... // OK: surrounded by paren<strong>the</strong>ses168

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!