Micro de 16 bits ? o 32 bits ?
Pregunto por alguna locura de alineacion, al ser 5 bytes puede que sea eso.. pero raro que lo ponga antes y no despues. A lo que le llaman "padding".
Es lo unico que se me ocurre. Si es de 8 bits no creo que ocurra esto.
Seguramente sea por la forma en la que el compilador alinea la estructura.
Busca por google structure alignment c++ a ver si te da alguna pista.
+-------+-------+
| code |
+-------+-------+
| code |
+-------+-------+
| code |
+-------+-------+
| code |
+-------+-------+
| code |
+-------+-------+
| code |
+-------+-------+
| code |
+-------+-------+
| code |
+-------+-------+
| contrl| rev |
+-------+-------+
| pin |
+-------+-------+
| year1 | mth1 |
+-------+-------+
| day1 | hr1 |
+-------+-------+
| min1 | |
+-------+-------+
| year2 | mth2 |
+-------+-------+
| day2 | hr2 |
+-------+-------+
| min2 | |
+-------+-------+
| nrec |
+-------+-------+It is relatively new to the compiler, that is why it's not documented yet.
You also have to be careful using it, because addressing a word pointer if it's not word aligned will cause address failure on a 16bit PIC. This should only happen if you manually created a pointer to an individual entry in the structure, which according to many C purists is bad code design.
"Care should be taken by the user when accessing individual elements of a packed struct – creating a pointer to 'b' in 'test' and attempting to dereference that pointer would cause an address fault. Any attempts to read/write 'b' should be done in context of 'test' so the compiler knows it is packed"
"Care should be taken by the user when accessing individual elements of a packed struct – creating a pointer to 'b' in 'test' and attempting to dereference that pointer would cause an address fault. Any attempts to read/write 'b' should be done in context of 'test' so the compiler knows it is packed"
Entonces quiere decir que se puede lograr crear un puntero, pero unicamente a la estructura principal y no un puntero a sus componentes?. Y acceder a los componentes de la estructura secundaria a traves de la estructura primaria?
Espero que haya sido claro como lo pregunte :P