meta data for this page
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
c [2020/04/14 12:55] – niziak | programming:c:start [2024/05/24 08:53] (current) – niziak | ||
---|---|---|---|
Line 3: | Line 3: | ||
====== printf format check ====== | ====== printf format check ====== | ||
- | <code c>extern int my_printf (void *my_object, const char *my_format, ...) __attribute__ ((format (printf, 2, 3)));</ | + | <code c> |
+ | extern int my_printf (void *my_object, const char *my_format, ...) __attribute__ ((format (printf, 2, 3))); | ||
+ | </ | ||
====== volatile ====== | ====== volatile ====== | ||
* **volatile uint8_t *foo;** - tells the compiler the memory being pointed to is volatile | * **volatile uint8_t *foo;** - tells the compiler the memory being pointed to is volatile | ||
- | * **uint8_t volatile * p_ledreg = 0x10000000; | + | * **uint8_t volatile * p_ledreg = 0x10000000; |
* **uint8_t * volatile foo;** - mark the pointer itself as volatile | * **uint8_t * volatile foo;** - mark the pointer itself as volatile | ||
====== compile time asserts ====== | ====== compile time asserts ====== | ||
+ | |||
+ | aka STATIC_ASSERT | ||
* Can be used in local block without compiler warning: | * Can be used in local block without compiler warning: | ||
Line 38: | Line 42: | ||
MAX_VALUE_SIGNED(a) : MAX_VALUE_UNSIGNED(a)) | MAX_VALUE_SIGNED(a) : MAX_VALUE_UNSIGNED(a)) | ||
</ | </ | ||
+ | |||
+ | ====== sizeof ====== | ||
+ | |||
+ | <code c> | ||
+ | #define member_size(type, | ||
+ | </ | ||