ARM Technical Support Knowledge Articles

LIMITS.H HEADER FILE PROBLEMS

Applies to: C251 C Compiler

Answer

QUESTION

Why does the LIMITS.H from DK251 have different values from the PK51?

ANSWER

This was a mistake in the CA251 and DK251 V2.14 release. The correct LIMITS.H file may be downloaded from the Keil web site or you may copy the updated file below:

/*--------------------------------------------------------------------------
LIMITS.H

ANSI standard include file for C251 Version 2.
Copyright (c) 1988-1999 Keil Elektronik GmbH and Keil Software, Inc.
All rights reserved.
--------------------------------------------------------------------------*/

#ifndef _LIMITS_INCLUDED
#define _LIMITS_INCLUDED

#define CHAR_BIT         8              /* Number of bits in any "char" */
#define CHAR_MAX         127            /* Max             "char" value */
#define CHAR_MIN       (-128)           /* Min             "char" value */
#define SCHAR_MAX        127            /* Max "signed"    "char" value */
#define SCHAR_MIN      (-128)           /* Min "signed"    "char" value */
#define UCHAR_MAX        255            /* Max "unsigned"  "char" value */
#define SHRT_MAX         32767          /* Max ("signed") "short" value */
#define SHRT_MIN       (-32768)         /* Min ("signed") "short" value */
#define USHRT_MAX        0xFFFF         /* Max "unsigned" "short" value */
#define INT_MAX          32767          /* Max ("signed")   "int" value */
#define INT_MIN        (-32768)         /* Min ("signed")   "int" value */
#define UINT_MAX         0xFFFF         /* Max "unsigned"   "int" value */
#define LONG_MAX         2147483647L    /* Max ("signed")  "long" value */
#define LONG_MIN   (-2147483647L-1L)    /* Min ("signed")  "long" value */
#define ULONG_MAX        0xFFFFFFFF     /* Max "unsigned"  "long" value */

#endif

Article last edited on: 2005-09-22 13:06:23

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential