* libc/include/stdint.h (SIZE_MIN): Remove.
(SIZE_MAX): Define. * testsuite/newlib.stdlib/stdlib.exp: New. * testsuite/newlib.stdlib/size_max.c: Likewise.
This commit is contained in:
		| @@ -1,3 +1,10 @@ | |||||||
|  | 2008-04-26  Mark Mitchell  <mark@codesourcery.com> | ||||||
|  |  | ||||||
|  | 	* libc/include/stdint.h (SIZE_MIN): Remove. | ||||||
|  | 	(SIZE_MAX): Define. | ||||||
|  | 	* testsuite/newlib.stdlib/stdlib.exp: New. | ||||||
|  | 	* testsuite/newlib.stdlib/size_max.c: Likewise. | ||||||
|  |  | ||||||
| 2008-04-29  Eric Blake  <ebb9@byu.net> | 2008-04-29  Eric Blake  <ebb9@byu.net> | ||||||
|  |  | ||||||
| 	Fix 2008-04-14 regression in asprintf(ptr,""). | 	Fix 2008-04-14 regression in asprintf(ptr,""). | ||||||
|   | |||||||
| @@ -348,8 +348,7 @@ typedef unsigned long uintptr_t; | |||||||
| #endif | #endif | ||||||
|  |  | ||||||
| /* This must match size_t in stddef.h, currently long unsigned int */ | /* This must match size_t in stddef.h, currently long unsigned int */ | ||||||
| #define SIZE_MIN (-__STDINT_EXP(LONG_MAX) - 1L) | #define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1) | ||||||
| #define SIZE_MAX __STDINT_EXP(LONG_MAX) |  | ||||||
|  |  | ||||||
| /* This must match sig_atomic_t in <signal.h> (currently int) */ | /* This must match sig_atomic_t in <signal.h> (currently int) */ | ||||||
| #define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1) | #define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1) | ||||||
|   | |||||||
							
								
								
									
										18
									
								
								newlib/testsuite/newlib.stdlib/size_max.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								newlib/testsuite/newlib.stdlib/size_max.c
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | |||||||
|  | #include <stddef.h> | ||||||
|  | #include <stdint.h> | ||||||
|  | #include <stdlib.h> | ||||||
|  |  | ||||||
|  | int main () { | ||||||
|  |   size_t s; | ||||||
|  |  | ||||||
|  |   s = SIZE_MAX; | ||||||
|  |   /* If SIZE_MAX is truncated when assigning to "s", then SIZE_MAX is | ||||||
|  |      too big.  */ | ||||||
|  |   if (s != SIZE_MAX) | ||||||
|  |     abort (); | ||||||
|  |   /* If SIZE_MAX + 1 is not zero, then SIZE_MAX is not big enough.  */ | ||||||
|  |   if (++s != 0) | ||||||
|  |     abort (); | ||||||
|  |  | ||||||
|  |   return 0; | ||||||
|  | } | ||||||
							
								
								
									
										10
									
								
								newlib/testsuite/newlib.stdlib/stdlib.exp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								newlib/testsuite/newlib.stdlib/stdlib.exp
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | |||||||
|  | # Copyright (C) 2008 by CodeSourcery, Inc.  All rights reserved. | ||||||
|  | # | ||||||
|  | # Permission to use, copy, modify, and distribute this software | ||||||
|  | # is freely granted, provided that this notice is preserved. | ||||||
|  |  | ||||||
|  | load_lib passfail.exp | ||||||
|  |  | ||||||
|  | set exclude_list [list "atexit.c"] | ||||||
|  |  | ||||||
|  | newlib_pass_fail_all -x $exclude_list | ||||||
		Reference in New Issue
	
	Block a user