I know the following code violates strict aliasing rules
int object = 10;
int *pi = &object; // OK
float *pf = (float *)pi; // OK
float f = *pf; // undefined behavior
In the header files of microcontroller peripherals, you can often find code
#define PERIPH_BASE ((uint32_t)0x40000000)
#define I2C1_BASE (APB1PERIPH_BASE + 0x5400)
#define I2C1 ((I2C_TypeDef *) I2C1_BASE)
How legal is it according to the C language standard to access memory through a pointer I2C1?
In its simplest form, the question comes down to how much the code
*(int *)0x1234 = 10;
is it legal and does it have any claims under the strict aliasing rules?