From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7118 invoked by alias); 27 Apr 2012 02:06:37 -0000 Received: (qmail 7016 invoked by uid 22791); 27 Apr 2012 02:06:37 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Apr 2012 02:06:12 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q3R268og013806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 26 Apr 2012 22:06:08 -0400 Received: from host2.jankratochvil.net (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q3R264Y4029278 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 26 Apr 2012 22:06:07 -0400 Date: Fri, 27 Apr 2012 07:11:00 -0000 From: Jan Kratochvil To: "Maciej W. Rozycki" Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] microMIPS support Message-ID: <20120427020603.GA24531@host2.jankratochvil.net> References: <20120426183713.GA21029@host2.jankratochvil.net> <20120426192611.GA24056@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-04/txt/msg00975.txt.bz2 On Thu, 26 Apr 2012 23:52:22 +0200, Maciej W. Rozycki wrote: > But are you absolutely sure that it was a supported construct with C89 or > are you only assuming having no counter-evidence? (a) C89 == C90: http://en.wikipedia.org/wiki/C89_%28C_version%29#C89 (b) The suggested 'const' construct is compliant with 'gcc -std=c89 -pedantic'. This does not prove it is really C89 compliant but: (c) GDB codebase is already not C90 compliant, at least not with 'gcc -std=c89 -pedantic', as discussed in the thread Re: [no-commit-intention] Naive unnamed fields for main_type http://sourceware.org/ml/gdb-patches/2012-02/msg00146.html I checked according to C90 const array means const elements of the array. And 'const type *var;' does not make 'var' const - my conclusion is qualifier 'const' is therefore independent for 'var' and the target type. > At the time I learnt C (some 18 years ago) that certainly wasn't a > construct I had seen in any language reference I do not see any problem using const for an array, what specifically do you see wrong here? > AFAIK we still require our code to conform to C89 (fortunately not K&R > anymore) or we could use lots of good stuff, I agree. I find const arrays compliant with C89. Thanks, Jan