🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49690

Re: Array syntax different from cfront-based compilers ?

#49690
From: David Kastrup
Date: Fri, 24 Dec 1993 23:09
27 lines
1820 bytes
fjh@munta.cs.mu.OZ.AU (Fergus Henderson) writes:

>jarausch@igpm.rwth-aachen.de (Helmut Jarausch) writes:

>>Please be patient if this is a FAQ, I haven't found it there.
>>/* ----------------------------------------------------
>>   this code compiles without problems on  AT&T cfront based compilers
>>*/
>>int main()
>>{ double  (*q)[5];
>>// assignment between incompatible pointer types why?
>>  q= new double[3][5];
>>  return 0;
>>}
>>
>>Since I am teaching C++ I would be glad if anybody could tell
>>me what's wrong with it.

>This is a g++ bug.
More precisely speaking, g++ mixes up the array dimensions. I suppose it
looks for a declarator, followed by [dimension];
In this case, this creates a 5-element array with elements being
3-element arrays, instead of the other way round.
-- 
 David Kastrup        dak@pool.informatik.rwth-aachen.de          
 Tel: +49-241-72419 Fax: +49-241-79502
 Goethestr. 20, D-52064 Aachen
Technical Details
Message-ID: <2ffsqv$4np@urmel.informatik.rwth-aachen.de>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!zib-berlin.de!uni-paderborn.de!urmel.informatik.rwth-aachen.de!hathi!dak
References: <2f6oo1$c31@urmel.informatik.rwth-aachen.de> <9335900.15517@mulga.cs.mu.OZ.AU>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,4ce18bb3e06a8b65
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-12-24 15:09:54 PST
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!zib-berlin.de!uni-paderborn.de!urmel.informatik.rwth-aachen.de!hathi!dak
From: dak@hathi.informatik.rwth-aachen.de (David Kastrup)
Newsgroups: gnu.gcc.help
Subject: Re: Array syntax different from cfront-based compilers ?
Date: 24 Dec 1993 23:09:19 GMT
Organization: Rechnerbetrieb Informatik - RWTH Aachen
Lines: 27
Distribution: world
Message-ID: <2ffsqv$4np@urmel.informatik.rwth-aachen.de>
References: <2f6oo1$c31@urmel.informatik.rwth-aachen.de> <9335900.15517@mulga.cs.mu.OZ.AU>
NNTP-Posting-Host: hathi.informatik.rwth-aachen.de
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Keywords: array syntax