From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27714 invoked by alias); 17 Aug 2005 20:25:20 -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 27680 invoked by uid 22791); 17 Aug 2005 20:25:13 -0000 Received: from mail.enyo.de (HELO mail.enyo.de) (212.9.189.167) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 17 Aug 2005 20:25:13 +0000 Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by albireo.enyo.de with esmtp id 1E5UTF-0001Wt-6b; Wed, 17 Aug 2005 22:25:09 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.52) id 1E5USu-00038J-1G; Wed, 17 Aug 2005 22:24:48 +0200 From: Florian Weimer To: Ian Lance Taylor Cc: "Kaveh R. Ghazi" , gcc@gcc.gnu.org, joseph@codesourcery.com Subject: Re: [PATCH]: Proof-of-concept for dynamic format checking References: <200508111509.j7BF9qMq015700@caipclassic.rutgers.edu> <87ll302wyb.fsf@mid.deneb.enyo.de> <87hddo2vrs.fsf@mid.deneb.enyo.de> Date: Wed, 17 Aug 2005 20:25:00 -0000 In-Reply-To: (Ian Lance Taylor's message of "17 Aug 2005 13:00:26 -0700") Message-ID: <87acjg2tww.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-08/txt/msg00479.txt.bz2 * Ian Lance Taylor: > Florian Weimer writes: > >> If I understand your %A/%B example correctly, it would look like this: > > OK, I can see how that might work in a simple case. Now, can you give > me an example of matching %d with the various flags? In particular, > are you going to write a loop, and is gcc going to somehow fully > unroll that loop at compile time? This is indeed a problem (with GCC 4.0 at least). A regexp builtin which returns the length of the matched string probably could probably solve this. Managing state so that you can still compose multiple checkers is the harder part, I think.