This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-sizeof()
- From: Jan Ringoš <tringi at mx-3 dot cz>
- To: <gcc at gnu dot org>
- Date: Thu, 18 Nov 2004 01:51:32 +0100
- Subject: -sizeof()
- Organization: n.v.t. MX-3
Hello, I am not a C++ guru, but this thing looks weird.
I have following two codes:
__int64 a = -4;
printf ("%016I64x\n", a); // prints fffffffffffffffc
__int64 b = -sizeof(int);
printf ("%016I64x\n", b); // prints 00000000fffffffc
Correct me if I am wrong, but shouldn't they return the same value (the first
one)??
I thought that sizeof is evaluated before converting to __int64 (long long)...
... MinGW 3.4.2, Win XP 32-bit ...
---
Jan Ringoš, Tringi@Mx-3.cz
http://Tringi.Mx-3.cz
senior programmer-analyst
n.v.t. MX-3, www.mx-3.cz