Related to 0 elements in a field of a Structure

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Psychophanta
Always Here
Always Here
Posts: 5153
Joined: Wed Jun 11, 2003 9:33 pm
Location: Anare
Contact:

Related to 0 elements in a field of a Structure

Post by Psychophanta »

Related to the Fred's conclusion in http://www.purebasic.fr/english/viewtopic.php?t=22327 :
Shouldn't be better that compiler complains with a '0 elements for a field is not allowed' error or something similar, instead of return a 0 for SizeOf() ?
http://www.zeitgeistmovie.com

while (world==business) world+=mafia;
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

But 0 elements IS allowed, so why should the compiler complain? 0 elements is for an array of unknown size.
Post Reply