From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 9 03:22:22 2008 Return-Path: Delivered-To: freebsd-hackers@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2287B1065686; Thu, 9 Oct 2008 03:22:22 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from mail.farley.org (farley.org [67.64.95.201]) by mx1.freebsd.org (Postfix) with ESMTP id E2FA78FC12; Thu, 9 Oct 2008 03:22:21 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from thor.farley.org (HPooka@thor.farley.org [192.168.1.5]) by mail.farley.org (8.14.3/8.14.3) with ESMTP id m9937WF7010679; Wed, 8 Oct 2008 22:07:32 -0500 (CDT) (envelope-from scf@FreeBSD.org) Date: Wed, 8 Oct 2008 22:07:32 -0500 (CDT) From: "Sean C. Farley" To: Ivan Voras In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Spam-Status: No, score=-4.3 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail.farley.org Cc: freebsd-hackers@FreeBSD.org Subject: Re: strftime's %c warning? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Oct 2008 03:22:22 -0000 On Wed, 8 Oct 2008, Ivan Voras wrote: > I'm trying to use the %c formatter in strftime(3), documented as: > > " > %c is replaced by national representation of time and date. > " > > ... which looks useful, except that in code in which WFORMAT is defined > as "1" I get this error: > > str.c: In function 'ltime': > str.c:141: warning: '%c' yields only last 2 digits of year in some > locales on non-BSD systems > *** Error code 1 > > Since the code I'm developing is definitely BSD-only (patch to pkg_* > infrastructure), should I: > > a) stop using locale-based %c and choose my own date/time format > b) remove WFORMAT from the Makefile? > > The same warning/error is generated by %x and %X, and %+ described in > the strftime man page isn't recognized. You are hitting a gcc builtin. Have you tried adding -fno-builtin-strftime? Sean -- scf@FreeBSD.org