From owner-freebsd-standards@FreeBSD.ORG Wed Jun 8 07:54:07 2005 Return-Path: X-Original-To: standards@freebsd.org Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C9DBA16A41C for ; Wed, 8 Jun 2005 07:54:07 +0000 (GMT) (envelope-from mike@reifenberger.com) Received: from mailout11.sul.t-online.com (mailout11.sul.t-online.com [194.25.134.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 22E3643D58 for ; Wed, 8 Jun 2005 07:54:04 +0000 (GMT) (envelope-from mike@reifenberger.com) Received: from fwd31.aul.t-online.de by mailout11.sul.t-online.com with smtp id 1DfvNz-00085d-03; Wed, 08 Jun 2005 09:54:03 +0200 Received: from fw.reifenberger.com (XBZcw2ZGQeAVkaPv-HNrQGXfVrTbQDaH30HjyFr8rYcWlR9hKk1esl@[84.152.95.217]) by fwd31.sul.t-online.de with esmtp id 1DfvNk-0LeSlU0; Wed, 8 Jun 2005 09:53:48 +0200 Received: from localhost (mike@localhost) by fw.reifenberger.com (8.13.3/8.13.3/Submit) with ESMTP id j587rFx2029984 for ; Wed, 8 Jun 2005 09:53:15 +0200 (CEST) (envelope-from mike@reifenberger.com) X-Authentication-Warning: fw.reifenberger.com: mike owned process doing -bs Date: Wed, 8 Jun 2005 09:53:15 +0200 (CEST) From: Michael Reifenberger To: standards@freebsd.org Message-ID: <20050608094851.D29843@fw.reifenberger.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-ID: XBZcw2ZGQeAVkaPv-HNrQGXfVrTbQDaH30HjyFr8rYcWlR9hKk1esl@t-dialin.net X-TOI-MSGID: c92042e4-33d8-486f-be4c-2e3ff4679fc3 Cc: Subject: libstand functions not ansi-c compiliant X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2005 07:54:07 -0000 Hi, as it seems are a few functions as defined/implemented in libstand not ansi-c compiant: putchar, vprintf, vsprintf. They are defined to return void instead of int. The following patch tries to correct that. Any objections to -commit? Index: printf.c =================================================================== RCS file: /home/ncvs/src/lib/libstand/printf.c,v retrieving revision 1.8 diff -u -r1.8 printf.c --- printf.c 6 Apr 2003 05:25:48 -0000 1.8 +++ printf.c 8 Jun 2005 07:48:23 -0000 @@ -75,11 +75,13 @@ return retval; } -void +int vprintf(const char *fmt, va_list ap) { + int retval; kvprintf(fmt, putchar, NULL, 10, ap); + return(retval); } int @@ -95,13 +97,14 @@ return retval; } -void +int vsprintf(char *buf, const char *cfmt, va_list ap) { int retval; retval = kvprintf(cfmt, NULL, (void *)buf, 10, ap); buf[retval] = '\0'; + return(retval); } /* Index: stand.h =================================================================== RCS file: /home/ncvs/src/lib/libstand/stand.h,v retrieving revision 1.41 diff -u -r1.41 stand.h --- stand.h 17 May 2005 17:46:29 -0000 1.41 +++ stand.h 8 Jun 2005 07:48:24 -0000 @@ -248,9 +248,9 @@ extern char *getdisklabel(const char *, struct disklabel *); extern int printf(const char *fmt, ...) __printflike(1, 2); -extern void vprintf(const char *fmt, __va_list); +extern int vprintf(const char *fmt, __va_list); extern int sprintf(char *buf, const char *cfmt, ...) __printflike(2, 3); -extern void vsprintf(char *buf, const char *cfmt, __va_list); +extern int vsprintf(char *buf, const char *cfmt, __va_list); extern void twiddle(void); @@ -369,7 +369,7 @@ */ extern int getchar(void); extern int ischar(void); -extern void putchar(int); +extern int putchar(int); extern int devopen(struct open_file *, const char *, const char **); extern int devclose(struct open_file *f); extern void panic(const char *, ...) __dead2 __printflike(1, 2); Bye/2 --- Michael Reifenberger, Business Development Manager SAP-Basis, Plaut Consulting Comp: Michael.Reifenberger@plaut.de | Priv: Michael@Reifenberger.com http://www.plaut.de | http://www.Reifenberger.com