| www.delorie.com/archives/browse.cgi | search |
| From: | jih-shin ho <u7711501 AT bicmos DOT ee DOT nctu DOT edu DOT tw> |
| Subject: | static variable initialization |
| To: | djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp) |
| Date: | Sat, 5 Jun 93 9:05:13 EAT |
Hi:
I find that gcc won't initialize static variable if you don't initialize
it by hand.
For example:
static int i; <-- The value of i is undefined.
static int i = 0; <-- You must use '= 0' to initialize i.
This behavior violates ANSI definition. Is this a bug ?
-- Jih-Shin Ho
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |