No, It is Immpossible. When you take sizeof(foo)
, you expect to get at least sizeof(int) + sizeof(intmax_t)
. If the compiler gave you a smaller size, this would incorrectly affect the behavior of the program, which is not allowed.
Suppose you put the last element as a "dummy" place holder, to ensure that the reserved hardware register is not used, or to ensure proper alignment. If the compiler removes such an element, it would break the program.
source share