From -4418654788903542144
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10f5bc,6f6e97a6fdbbf44c
X-Google-Attributes: gid10f5bc,public
X-Google-Thread: 109fba,6f6e97a6fdbbf44c
X-Google-Attributes: gid109fba,public
X-Google-Thread: 1014db,6f6e97a6fdbbf44c
X-Google-Attributes: gid1014db,public
X-Google-Thread: 1149ec,6f6e97a6fdbbf44c
X-Google-Attributes: gid1149ec,public
X-Google-Thread: 110292,6f6e97a6fdbbf44c
X-Google-Attributes: gid110292,public
X-Google-Thread: f78e5,6f6e97a6fdbbf44c
X-Google-Attributes: gidf78e5,public
X-Google-Thread: 102b75,6f6e97a6fdbbf44c
X-Google-Attributes: gid102b75,public
From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
Subject: Re: And you thought that the Pentium bug was bad!  (Get a load of this!)
Date: 1995/06/23
Message-ID: <3seo3n$7ce@newshost.lanl.gov>#1/1
X-Deja-AN: 104892030
distribution: world
references: <3s2las$1br@hustle.rahul.net> <DAM6Mo.A3G@ukpsshp1.serigate.philips.nl>
organization: Los Alamos National Laboratory
newsgroups: comp.std.c,comp.std.c++,comp.lang.c,comp.lang.c++,comp.sys.intel,comp.arch,comp.software.testing

In article <DAM6Mo.A3G@ukpsshp1.serigate.philips.nl>,
baynes@ukpsshp1.serigate.philips.nl (Stephen Baynes) writes: 
<snip>
|> Supose instead one had written:
|> 
|> double d = 0.9;
|>  
|> int
|> main ()
|> {
|>     double d = 0.8;
|>     {
|>         extern int d;
|>  
|>         return 0;
|>     }
|> }
|> 
|> From the discussions on this the inner and outer 'd's are the same thing,
so 
|> this code is incorrect. My question is this an error for which the
compiler 
|> is expected to produce a diagnostic - or is it like normal external
linkage 
|> missmatches where the compiler is not expected to produce a diagnostic
(though 
|> the linker might)?

The only _constraint_ (i.e. requirement of diagnostic) is that all
declarations in the same scope and in the same name space specify compatible
types. (i.e. this is the only one I could find: this is in 6.5). Any other 
incompatible declaration of the same object leads to undefined behaviour, I
think (6.1.2.6). So, your program does not need a diagnostic, I believe, even
if double d = 0.8 is removed (but I would hate a compiler which did not warn
me of it under those conditions).

I may be wrong about this one.

Cheers
Tanmoy
-- 
tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87544-0285,USA H:#3,802,9 St,NM87545
Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
<http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]



