From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15198 invoked by alias); 10 Dec 2004 15:44:18 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 15166 invoked from network); 10 Dec 2004 15:44:12 -0000 Received: from unknown (HELO duke.cs.duke.edu) (152.3.140.1) by sourceware.org with SMTP; 10 Dec 2004 15:44:12 -0000 Received: from eenie.cs.duke.edu (eenie.cs.duke.edu [152.3.140.22]) by duke.cs.duke.edu (8.13.1/8.13.1) with ESMTP id iBAFiC7c021409 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 10 Dec 2004 10:44:12 -0500 (EST) Received: (from trt@localhost) by eenie.cs.duke.edu (8.12.10/8.12.10/Submit) id iBAFiC0P004241 for gcc@gcc.gnu.org; Fri, 10 Dec 2004 10:44:12 -0500 (EST) From: "Thomas R. Truscott" Message-Id: <200412101544.iBAFiC0P004241@eenie.cs.duke.edu> Subject: Re: Unomitted frame pointers To: gcc@gcc.gnu.org Date: Fri, 10 Dec 2004 15:44:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-12/txt/msg00361.txt.bz2 Off-topic, but the hello.c program does: write(2, "Hello World!\n\0", 16); The string length is 15, not 16. It would be nice if gcc issued warnings for compile-time constant string/length pairs where the length is too large. I do that in my local copy of gcc, and it routinely finds coding mistakes for memcpy(). Perhaps this could somehow be an "attribute" that gcc can check. (Hmm, the attribute thing is too limited, what would be really nice is a way to write code that does general compile-time argument checking. Then one could do more thorough checks such as is done for printf/scanf. And the same code could be invoked at run time ... oops, way off topic.) Tom Truscott