View Single Post
Old September 23, 2009, 19:18   #9
zaimoni
Knight
 
zaimoni's Avatar
 
Join Date: Apr 2007
Posts: 590
zaimoni is on a distinguished road
Quote:
Originally Posted by zaimoni View Post
The parameter const u32b attrs[] is decayed at compile time to const u32b *attrs . The language standards (C90/C99/C1X) require 1==N_ELEMENTS(attrs).
Decay happens, but the equality is wrong. The result does have nothing to do with the original size of the static array, but is rather likely to be a small integer as the actual expression ends up being equal to sizeof(u32b*)/sizeof(u32b).

The most likely values on real platforms (8-bit bytes) would be:
0: 64-bit pointers (e.g., native Win64 build)
1: 32-bit pointers (e.g., native Win32 build)
2: 16-bit pointers (if non-extended DOS build were resurrected)
__________________
Zaiband: end the "I shouldn't have survived that" experience. V3.0.6 fork on Hg.
Zaiband 3.0.10 ETA Mar. 7 2011 (Yes, schedule slipped. Latest testing indicates not enough assert() calls to allow release.)
Z.C++: pre-alpha C/C++ compiler system (usable preprocessor). Also on Hg. Z.C++ 0.0.10 ETA December 31 2011
zaimoni is offline   Reply With Quote