Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 May 1997 13:48:30 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        hackers@FreeBSD.ORG, j@uriah.heep.sax.de, core@FreeBSD.ORG
Subject:   Re: Variable initialization
Message-ID:  <199705191148.NAA04574@labinfo.iet.unipi.it>
In-Reply-To: <199705191131.VAA13078@godzilla.zeta.org.au> from "Bruce Evans" at May 19, 97 09:31:22 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> >> 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;

        <no other code here, just declarations>

	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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705191148.NAA04574>