From: Gabor Lenart (lgb_at_lgb.hu)
Date: 2005-04-01 11:52:43
On Fri, Apr 01, 2005 at 10:44:21AM +0200, Ullrich von Bassewitz wrote: > This is just an idea, and I'm not sure if it is useful, so let me explain: The > C standard guarantees that anything not intialized explicitly in the source > has the '0' value of the data type. This must not necessarily correspond to a ? Really? I've never seen this rule! In fact when I was learnt to code C it was told that uninitialized variables has TOTALLY UNDEFINED value, you can't assume anything. However maybe I'm wrong here ... In fact, some teacher at the University said uninitalized variables has zero value (?) because "Microsoft Visual C do this for you" (well, true: he strongly beleived that the truth is not out there but at Microsoft ...). I'm starting to think that I don't know exactly the rule for this situation, now ... > Please don't take this idea as a request. I'm not sure myself, how useful it > is. If the flag is in the header, it would require more code to check the At least it can't hurt :) > header. Requiring this bit to be set in the header for the cc65 module loader > is possible. This would leave the header check as is, but save the code and > time overhead of the bss fill. It would also make the loader dangerous when > loading code written in C, because uninitialized data will now contain random But as I've written: I was told that it's COMPLETLY illegal to use a variable which was not initalized before ... So in thoery you should not do this however. Or at least you can, but it is NOT PORTABLE code in C, if you try to compile it on other platform and/or compiler. - Gábor Message was sent through the cbm-hackers mailing list
Archive generated by hypermail pre-2.1.8.