From owner-freebsd-standards Mon Oct 7 12:10: 5 2002 Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A27FE37B401 for ; Mon, 7 Oct 2002 12:10:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E00A043E91 for ; Mon, 7 Oct 2002 12:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g97JA2Co016982 for ; Mon, 7 Oct 2002 12:10:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g97JA2kt016981; Mon, 7 Oct 2002 12:10:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 86B3137B401 for ; Mon, 7 Oct 2002 12:03:32 -0700 (PDT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 430EE43E6E for ; Mon, 7 Oct 2002 12:03:32 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g97J3W7R078252 for ; Mon, 7 Oct 2002 12:03:32 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.6/8.12.6/Submit) id g97J3WFV078251; Mon, 7 Oct 2002 12:03:32 -0700 (PDT) Message-Id: <200210071903.g97J3WFV078251@www.freebsd.org> Date: Mon, 7 Oct 2002 12:03:32 -0700 (PDT) From: Peter Johnson To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: standards/43780: PATCH: long long functions in stdlib.h should be wrappered with __STRICT_ANSI__ Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >Number: 43780 >Category: standards >Synopsis: PATCH: long long functions in stdlib.h should be wrappered with __STRICT_ANSI__ >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Oct 07 12:10:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Peter Johnson >Release: 4.7-RC >Organization: >Environment: FreeBSD powerplant.home.bilogic.org 4.7-RC FreeBSD 4.7-RC #7: Mon Oct 7 01:01:51 PDT 2002 freebsd@powerplant.home.bilogic.org:/usr/obj/usr/src/sys/WORKSTATION i386 >Description: Compiling code that includes stdlib.h with the GCC options -ansi -pedantic reports the following warnings on two lines of stdlib.h: /usr/include/stdlib.h:110: warning: ANSI C does not support `long long' /usr/include/stdlib.h:114: warning: ANSI C does not support `long long' These lines are the strtoll and strtoull functions. >How-To-Repeat: Compile a short program with gcc -ansi -pedantic that includes stdlib.h: #include int main() { return 0; } >Fix: Add #ifndef __STRICT_ANSI__ wrappers around the offending lines: --- include/stdlib.h.orig Wed Aug 14 19:07:57 2002 +++ include/stdlib.h Mon Oct 7 12:00:48 2002 @@ -106,12 +106,16 @@ void srand __P((unsigned)); double strtod __P((const char *, char **)); long strtol __P((const char *, char **, int)); +#ifndef __STRICT_ANSI__ long long strtoll __P((const char *, char **, int)); +#endif unsigned long strtoul __P((const char *, char **, int)); +#ifndef __STRICT_ANSI__ unsigned long long strtoull __P((const char *, char **, int)); +#endif int system __P((const char *)); int mblen __P((const char *, size_t)); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message