The __vector_24 instruction is the name of a type of vector register in the GNU C library. It is defined in GASP in the file `gas.h`. The __vector_24 instruction is used when the compiler is attempting to use a vector register to allocate memory for one or more variables.
The __vector_24 instruction, in its most common use, is used to allocate memory for a variable of a specific type. For example, it is used when you need to allocate memory for a pointer variable of a given type, or allocate memory for a structure or function of a given type. Sometimes, you can also use this instruction to allocate memory for a data structure, variable, or variable array of the same type.
That’s a vector register, which is a register that contains 16-bit variables of a specific type. This makes it easier to allocate memory for the first 16 bits of a float number or for a pointer to a structure, as we can do the same for a pointer to a vector.
It’s also worth noting that the size of a vector registers is variable depending on how big the structure you’re making is. I’ve seen the size of an array be 1 or 2 bytes, but for a vector type it is 32 bits. So if you need to allocate memory for a pointer of a vector, that’s why you’d use this (or why you’d use the +0x0 instruction).
I think these bits would be very useful if you wanted to allocate space for a vector of pointers to structures. I would hate to have to allocate a big block of memory for a structure and then use the 0x0 instruction to deallocate it. The other reason for using the size/vector type is because you need to use the size of a pointer/vector to count the number of elements in a vector, which we could easily do with a structure or with sizeof(struct).
Well, I’m not saying that the 0x0 instruction is a bad thing. I just don’t see how using it could possibly be better. If you have a vector of pointers to structures, then why not just use sizeof rather than sizeofstruct? You may want to use the size of a pointervector, but if you just use sizeof struct, it would be better to just use the size of the pointervector type rather than the size of the structure.
So the compiler may be right. That vector can be defined as having four elements, and the compiler may well be right that sizeof struct is 4. If so, then sizeof(struct foo) would be 4. If not, then the compiler is wrong or you’re using the wrong type. Either way, it doesn’t matter because there is no way these types could be any smaller than 4 elements, so the compiler can’t possibly be right.
I think the compiler is right. I think you are right, and the only way the compiler could possibly be wrong is that you are using the wrong type, which would mean that the size of the vector is actually 4, which would mean that sizeofstruct makes sense, because sizeof is always 4. So your compiler error is a matter of interpretation and not an error.
So let me rephrase this. It is impossible for the compiler to be wrong when it is using a type that is not defined in the standard.
This is a bit of an oversimplification of what was actually said, but the important thing to realize when you have multiple types that are defined in a standard is that you can’t know which one is actually defined. This is an important lesson from the days of pre-C99 languages, because prior to C, you had to know which function was defined before you could use any given type in a program.