From owner-svn-src-projects@FreeBSD.ORG Tue May 14 20:05:25 2013 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BDDEDD4F for ; Tue, 14 May 2013 20:05:25 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) by mx1.freebsd.org (Postfix) with ESMTP id 4653A8AA for ; Tue, 14 May 2013 20:05:24 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id x10so1082845lbi.35 for ; Tue, 14 May 2013 13:05:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=lfk+XAwgzoWi054VSdfbgpLZiXvjPaI+uG/LOOnT5U4=; b=Vh7jUBhIfZpjfDjVozkgXo6HrZ6oFUBHSWvTJNnC0QJVzh3yVNIhM035wnQhLmd8qI K9Duk40Mk/I/ZVMP2xoK8q+w55AsD1mgONMi0JFfz0nM/aR+d5ugto+YOnMR8b0EGMry cVfwRYwiGzK0wlUPAMuOlu1E0GTJpxfJrslUWyqZOucXt1CXe2SQs4LDziqK2xnSpUuP 2AjU+dxALe/mlI+Mqh5seFjqM5kdkLOsY22NVvvqjmx0kOAzoV0Ecwrwzi8NOmrgzF7B ZaKecIjJPAA8WoBAJLZneWTtlBcL/KIC+arPAK1mjzt4Lz4A9j6dV+uDLSdmPFMhgKK/ xSaA== X-Received: by 10.112.126.40 with SMTP id mv8mr16087498lbb.122.1368561918005; Tue, 14 May 2013 13:05:18 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.152.7.70 with HTTP; Tue, 14 May 2013 13:04:57 -0700 (PDT) In-Reply-To: <201305141916.r4EJGs2Y056601@svn.freebsd.org> References: <201305141916.r4EJGs2Y056601@svn.freebsd.org> From: Juli Mallett Date: Tue, 14 May 2013 13:04:57 -0700 X-Google-Sender-Auth: mFVaT1B9JpunUacjGhKXdvdzq0s Message-ID: Subject: Re: svn commit: r250638 - in projects/flex-sf: contrib/flex usr.bin/lex/lib To: Jung-uk Kim Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnF3es7pKQVZneVHPsCp8ucQsSgZa9KbNcvnPHYAWXMhhmpR66DbtMKBUvVOSgD9ZfUrY8n Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 May 2013 20:05:25 -0000 On Tue, May 14, 2013 at 12:16 PM, Jung-uk Kim wrote: > Log: > Fix build with GCC. > Modified: projects/flex-sf/contrib/flex/scanflags.c > ============================================================================== > --- projects/flex-sf/contrib/flex/scanflags.c Tue May 14 17:32:13 2013 (r250637) > +++ projects/flex-sf/contrib/flex/scanflags.c Tue May 14 19:16:54 2013 (r250638) > @@ -62,7 +62,7 @@ sf_init (void) > _sf_stk = (scanflags_t*) flex_alloc ( sizeof(scanflags_t) * (_sf_max = 32)); > if (!_sf_stk) > lerrsf_fatal(_("Unable to allocate %ld of stack"), > - (long)sizeof(scanflags_t)); > + (void *)(uintptr_t)sizeof(scanflags_t)); > _sf_stk[_sf_top_ix] = 0; > } This looks pretty strange. Moreover, it's not clear to me what the benefit is of showing the sizeof scanflags_t, which isn't the amount attempting to be allocated anyway, it's sizeof scanflags_t * 32, right? (The assignment in the multiplication in the allocation is pretty shady, too.) But really, why does %ld expect a pointer? Is lerrsf_fatal some esoteric thing that doesn't take varargs or use normal format strings? If not, just use %zu and get rid of the cast rollercoaster? The pointer cast is pretty astonishingly-odd anyway. Juli.