🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c.moderated
Article #2663

language law question

#2663
From: Alan Lehotsky
Date: Wed, 01 Jul 1998 00:00
37 lines
1583 bytes
Is the following legal?

I checked ANSI X3.159-1989, and can't find anything that forbids it.


   int dop[][] = {{1,2,3}, {4,5,6}};

I was expecting a constraint saying something like 

      ... for an array of type T, T must be a fully specified
      type.

But it's not stated that obviously if it is a constraint.      

GCC doesn't accept it, and issues the diagnostic errors

sw131.c: In function `empty_aggregate_bounds_error':
sw131.c:3: elements of array `dop' have incomplete type
sw131.c:3: array size missing in `dop'
sw131.c:3: storage size of `dop' isn't known

The MetroWerks C compiler does accept this syntax.


-- Al Lehotsky

-- 
         Quality Software Management
     http://www.tiac.net/users/lehotsky
              lehotsky@tiac.net
             (978)287-0435 Voice

Software Process Improvement and Management Consulting
      Language Design and Compiler Implementation
-- 
comp.lang.c.moderated - clcm@plethora.net
Technical Details
Message-ID: <clcm-19980630-0026@plethora.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,457ad7ff6ee38253,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: 100850,457ad7ff6ee38253,start
X-Google-Attributes: gid100850,public
From: lehotsky@tiac.net (Alan Lehotsky)
Subject: language law question
Date: 1998/07/01
Message-ID: <clcm-19980630-0026@plethora.net>
X-Deja-AN: 367596448
Approved: clc@plethora.net
NNTP-Posting-Date: Tue, 30 Jun 1998 19:51:27 CDT
Originator: clcm@plethora.net (comp.lang.c.moderated)
Organization: Quality Software Management
Newsgroups: comp.lang.c.moderated,gnu.gcc.help