Date: Tue, 30 Mar 2004 22:18:26 +0200 (CEST) From: Stefan Farfeleder <stefan@fafoe.narf.at> To: FreeBSD-gnats-submit@FreeBSD.org Cc: stefan@fafoe.narf.at Subject: standards/64956: [patch] <stdint.h> occasionally fails to define WINT_MIN and WINT_MAX Message-ID: <20040330201826.A449147B@wombat.fafoe.narf.at> Resent-Message-ID: <200403302020.i2UKKIbM055520@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 64956 >Category: standards >Synopsis: [patch] <stdint.h> occasionally fails to define WINT_MIN and WINT_MAX >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: Tue Mar 30 12:20:17 PST 2004 >Closed-Date: >Last-Modified: >Originator: Stefan Farfeleder >Release: FreeBSD 5.2-CURRENT i386 >Organization: >Environment: System: FreeBSD wombat.fafoe.narf.at 5.2-CURRENT FreeBSD 5.2-CURRENT #17: Sat Mar 20 15:52:00 CET 2004 stefan@wombat.fafoe.narf.at:/usr/home/stefan/freebsd/obj/usr/home/stefan/freebsd/src/sys/WOMBAT i386 >Description: <machine/_stdint.h> defines the macros WINT_MIN and WINT_MAX only if WCHAR_MIN is not defined. Including <wchar.h> defines WCHAR_MIN but not WINT_MIN and WINT_MAX, so this is clearly wrong. Since <machine/_stdint.h> is the only header defining those two macros, no test at all is necessary. >How-To-Repeat: $ cat wint_min.c #include <wchar.h> #include <stdint.h> int i = WINT_MIN; $ c99 -c wint_min.c wint_min.c:3: error: `WINT_MIN' undeclared here (not in a function) $ >Fix: --- wint_min_max.diff begins here --- Index: src/sys/alpha/include/_stdint.h =================================================================== RCS file: /usr/home/ncvs/src/sys/alpha/include/_stdint.h,v retrieving revision 1.1 diff -I.svn -u -r1.1 _stdint.h --- src/sys/alpha/include/_stdint.h 29 Jul 2002 17:41:06 -0000 1.1 +++ src/sys/alpha/include/_stdint.h 30 Mar 2004 19:48:11 -0000 @@ -160,11 +160,11 @@ /* Limits of wchar_t. */ #define WCHAR_MIN INT32_MIN #define WCHAR_MAX INT32_MAX +#endif /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX -#endif #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ Index: src/sys/amd64/include/_stdint.h =================================================================== RCS file: /usr/home/ncvs/src/sys/amd64/include/_stdint.h,v retrieving revision 1.2 diff -I.svn -u -r1.2 _stdint.h --- src/sys/amd64/include/_stdint.h 21 Nov 2003 03:02:00 -0000 1.2 +++ src/sys/amd64/include/_stdint.h 30 Mar 2004 19:48:15 -0000 @@ -160,11 +160,11 @@ /* Limits of wchar_t. */ #define WCHAR_MIN INT32_MIN #define WCHAR_MAX INT32_MAX +#endif /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX -#endif #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ Index: src/sys/arm/include/_stdint.h =================================================================== RCS file: /usr/home/ncvs/src/sys/arm/include/_stdint.h,v retrieving revision 1.1 diff -I.svn -u -r1.1 _stdint.h --- src/sys/arm/include/_stdint.h 29 Jul 2002 17:41:07 -0000 1.1 +++ src/sys/arm/include/_stdint.h 30 Mar 2004 19:48:19 -0000 @@ -160,11 +160,11 @@ /* Limits of wchar_t. */ #define WCHAR_MIN INT32_MIN #define WCHAR_MAX INT32_MAX +#endif /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX -#endif #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ Index: src/sys/i386/include/_stdint.h =================================================================== RCS file: /usr/home/ncvs/src/sys/i386/include/_stdint.h,v retrieving revision 1.1 diff -I.svn -u -r1.1 _stdint.h --- src/sys/i386/include/_stdint.h 29 Jul 2002 17:41:07 -0000 1.1 +++ src/sys/i386/include/_stdint.h 30 Mar 2004 19:48:22 -0000 @@ -160,11 +160,11 @@ /* Limits of wchar_t. */ #define WCHAR_MIN INT32_MIN #define WCHAR_MAX INT32_MAX +#endif /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX -#endif #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ Index: src/sys/ia64/include/_stdint.h =================================================================== RCS file: /usr/home/ncvs/src/sys/ia64/include/_stdint.h,v retrieving revision 1.1 diff -I.svn -u -r1.1 _stdint.h --- src/sys/ia64/include/_stdint.h 29 Jul 2002 17:41:08 -0000 1.1 +++ src/sys/ia64/include/_stdint.h 30 Mar 2004 19:48:26 -0000 @@ -160,11 +160,11 @@ /* Limits of wchar_t. */ #define WCHAR_MIN INT32_MIN #define WCHAR_MAX INT32_MAX +#endif /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX -#endif #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ Index: src/sys/powerpc/include/_stdint.h =================================================================== RCS file: /usr/home/ncvs/src/sys/powerpc/include/_stdint.h,v retrieving revision 1.1 diff -I.svn -u -r1.1 _stdint.h --- src/sys/powerpc/include/_stdint.h 29 Jul 2002 17:41:16 -0000 1.1 +++ src/sys/powerpc/include/_stdint.h 30 Mar 2004 19:48:30 -0000 @@ -160,11 +160,11 @@ /* Limits of wchar_t. */ #define WCHAR_MIN INT32_MIN #define WCHAR_MAX INT32_MAX +#endif /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX -#endif #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ Index: src/sys/sparc64/include/_stdint.h =================================================================== RCS file: /usr/home/ncvs/src/sys/sparc64/include/_stdint.h,v retrieving revision 1.1 diff -I.svn -u -r1.1 _stdint.h --- src/sys/sparc64/include/_stdint.h 29 Jul 2002 17:41:16 -0000 1.1 +++ src/sys/sparc64/include/_stdint.h 30 Mar 2004 19:48:52 -0000 @@ -160,11 +160,11 @@ /* Limits of wchar_t. */ #define WCHAR_MIN INT32_MIN #define WCHAR_MAX INT32_MAX +#endif /* Limits of wint_t. */ #define WINT_MIN INT32_MIN #define WINT_MAX INT32_MAX -#endif #endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ --- wint_min_max.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040330201826.A449147B>