Path: utzoo!utgpu!attcan!uunet!ginosko!uakari.primate.wisc.edu!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: Declarations in switches, errors Message-ID: <11202@smoke.BRL.MIL> Date: 1 Oct 89 00:25:47 GMT References: <561@crdos1.crd.ge.COM> <11158@smoke.BRL.MIL> <637@crdos1.crd.ge.COM> <1989Sep30.052000.13719@utzoo.uucp> <30540@news.Think.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 18 In article <30540@news.Think.COM> barmar@kulla (Barry Margolin) writes: >Well, since the initial value of automatic variables is undefined, a >conforming implementation COULD execute them. NO, not in general. (The only time it could occur is if it would have no observable effect! What would be the point of that?) >why does the standard permit initializers in declarations at the head >of a switch body, if they are required to be ignored? Because it's attempting to standardize C, not some vaguely similar language. The initializer IS NOT REQUIRED TO BE IGNORED. It is treated EXACTLY like any other auto initializer. Static initializers in a switch body are also treated like any other static initializers. You guys have the wrong mental model of C initialization!