3 ms·
The point still stands, but I think sizeof(int*) or sizeof(int) is a poor example, because it could be compiled to a portable "getelementptr" LLVM instruction.
by exDM69 10y ago
The point still stands, but I think sizeof(int*) or sizeof(int) is a poor example, because it could be compiled to a portable "getelementptr" LLVM instruction.
However, Clang does not do this and emits a constant integer for sizeof() operations (according to my quick and dirty test).