🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #6060

Tentative defs, type compatibility.

#6060
From: Alan Mycroft
Date: Thu, 25 May 1989 09:20
10 lines
858 bytes
Consider the following dpANS C program:
   int x[10];
   int x[] = { 1,2 };
Does the x[10] and x[] get unified together before the initialisation of
x[10] to {1,2,0,0,...} or does the initialisation of x to (int[2]){1,2}
happen first and cause a type conflict with x[10]?

I can see arguments both way (more programs are legal vs. lack of
symmetry -- most other top-level declarations are order-independent), but
the dpANS does not immediately explain.  Views?
Technical Details
Message-ID: <754@scaup.cl.cam.ac.uk>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!cam-cl!am

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcvax!ukc!cam-cl!am
From: am@cl.cam.ac.uk (Alan Mycroft)
Newsgroups: comp.std.c
Subject: Tentative defs, type compatibility.
Summary: who wins for size of [] array
Message-ID: <754@scaup.cl.cam.ac.uk>
Date: 25 May 89 09:20:03 GMT
Sender: news@cl.cam.ac.uk
Reply-To: am@cl.cam.ac.uk (Alan Mycroft)
Organization: U of Cambridge Comp Lab, UK
Lines: 10