From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19878 invoked by alias); 7 Nov 2013 19:03:16 -0000 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 Received: (qmail 19869 invoked by uid 89); 7 Nov 2013 19:03:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE,SPAM_SUBJECT,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Nov 2013 19:03:15 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA7J3718026809 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Nov 2013 14:03:07 -0500 Received: from barimba (ovpn-113-94.phx2.redhat.com [10.3.113.94]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rA7J35dQ004707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 7 Nov 2013 14:03:06 -0500 From: Tom Tromey To: Sanimir Agovic Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 03/10] vla: enable sizeof operator to work with variable length arrays References: <1382366424-21010-1-git-send-email-sanimir.agovic@intel.com> <1382366424-21010-4-git-send-email-sanimir.agovic@intel.com> Date: Thu, 07 Nov 2013 19:10:00 -0000 In-Reply-To: <1382366424-21010-4-git-send-email-sanimir.agovic@intel.com> (Sanimir Agovic's message of "Mon, 21 Oct 2013 16:40:17 +0200") Message-ID: <87a9hguj9y.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-11/txt/msg00203.txt.bz2 >>>>> "Sanimir" == Sanimir Agovic writes: Sanimir> In C99 the sizeof operator computes the size of a variable Sanimir> length array at runtime (6.5.3.4 The sizeof operator). This Sanimir> patch reflects the semantic change in the debugger. Sanimir> We now are able to get the size of a vla: Sanimir> 1| void foo (size_t n) { Sanimir> 2| int vla[n]; Sanimir> 3| } Sanimir> (gdb) p sizeof(vla) Sanimir> yields N. It should yield N * sizeof(int), but I imagine that was just a minor oversight in your email, as the patch looks correct to me. Tom