So you're saying that this code:
#include <stdio.h> int value; void main(void) { printf("%d\n", value); }
may output something else then 0 on these platforms/compilers? Looking at ANSI C (as the smallest common base) I would say these compilers are in violation of the C Standard and cannot be truly called C. (But I may be wrong - I'm not a greybearded C guru.)
From the C89 standard, section 3.5.7
If an object that has static storage duration is not initialized explicitly, it is initialized implicitly as if every member that has arithmetic type were assigned 0 and every member that has pointer type were assigned a null pointer constant.(I am deliberately quoting C89 and not a more recent standard too make sure this isn't a later addition / clarification.)
In reply to Re^5: porting C code to Perl
by Monk::Thomas
in thread porting C code to Perl
by Discipulus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |