meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
programming:c:ceedling [2021/04/22 12:02] niziakprogramming:c:ceedling [2021/04/22 12:52] niziak
Line 26: Line 26:
 </code> </code>
  
 +===== extern keyword =====
 +<code>
 +WARNING: No function prototypes found!
 +</code>
 +By default ''cmock'' will ignore ''extern'' function (is not mocking them). To enable mocking of ''extern'' functions:
 +<code yaml>
 +:cmock:
 +  :treat_externs: :include
 +</code>
  
  
 +===== volatile function parameters =====
 +<code c>
 +void myfn(custom_t *m, volatile uint32_t *var);
  
 +error: conflicting types for ...
 +</code>
  
 +[[https://github.com/ThrowTheSwitch/CMock/issues/135|CMock chokes on volatile function parameters #135]]
 +
 +  The C99 standard recommends against using volatile as function call parameters and as return values, 
 +  stating that it is undefined behavior (because it is implementation-  specific) and therefore should 
 +  not be depended upon.
 +
 +  * **Workaround1:** is to use macro for volatile and redefine it to nothing when ''TEST''.
 +  * **Workaround2:** is to use ''typedef volatile uint32_t my_volatile_type;''