• declare a variable with flexible array members (c99)
    Hello everyone, in c99 I can make a struct with a flexible array member at the end. Is it possible to create such a variable at compile time? e.g: struct monitoredArray { unsigned int const...
  • declare a variable with flexible array members (c99)
    Hello everyone, in c99 I can make a struct with a flexible array member at the end. Is it possible to create such a variable at compile time? e.g: struct monitoredArray { unsigned int const...
  • Declare variable in the same location as that of a struct member
    Hi All, Am trying to re-write a code in PLM51 to embedded C. There is a statement in PLM51 as below. DECLARE TASK(17) STRUCTURE(PNTR BYTE,STATUS BYTE,DELAY WORD); DECLARE DELAY_HEAD BYTE AT (...
  • Declare variable in the same location as that of a struct member
    Hi All, Am trying to re-write a code in PLM51 to embedded C. There is a statement in PLM51 as below. DECLARE TASK(17) STRUCTURE(PNTR BYTE,STATUS BYTE,DELAY WORD); DECLARE DELAY_HEAD BYTE AT (...
  • Compiler assumes array addresses are aligned for structs declared with __attribute__((packed))
    If I have a struct declared like the following: volatile struct { uint8_t foo; int16_t bar[1]; } __attribute__((packed)) foobar; The code emitted uses LDRSH to access bar[0] and causes a hardfault...