From owner-freebsd-hackers Mon May 19 06:30:09 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id GAA21063 for hackers-outgoing; Mon, 19 May 1997 06:30:09 -0700 (PDT) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id GAA20688; Mon, 19 May 1997 06:21:15 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id NAA04574; Mon, 19 May 1997 13:48:30 +0200 From: Luigi Rizzo Message-Id: <199705191148.NAA04574@labinfo.iet.unipi.it> Subject: Re: Variable initialization To: bde@zeta.org.au (Bruce Evans) Date: Mon, 19 May 1997 13:48:30 +0200 (MET DST) Cc: hackers@FreeBSD.ORG, j@uriah.heep.sax.de, core@FreeBSD.ORG In-Reply-To: <199705191131.VAA13078@godzilla.zeta.org.au> from "Bruce Evans" at May 19, 97 09:31:22 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > >> Can someone tell me why this is called obfuscation ? > > With old compilers, it was a pessimization to initalize variables > unnecessarily or long before they are used. With modern compilers, > it defeats automatic checking for uninitialized variables and may > still prevent some optimizations. I made on purpose the example int a, b, c; a=1 ; b = 2 ; c = 3 ; where none of the above presumably applies. > still prevent some optimizations. A wrongly initialized variable > is worse than an initialized one since it can't be checked for. this is as obvious as useless. The compiler won't catch a wrong init value, either in the declaration or in an explicit assignement. But anyways I was just trying to understand if there was something fundamentally wrong in my preference of int a = 3; in place of int a ; a = 3 ; Cheers Luigi