[cfe-commits] r63945 - /cfe/trunk/lib/Headers/limits.h

Sebastian Redl sebastian.redl at getdesigned.at
Fri Feb 6 12:08:50 PST 2009


Chris Lattner wrote:
> Author: lattner
> Date: Fri Feb  6 12:34:27 2009
> New Revision: 63945
>
> URL: http://llvm.org/viewvc/llvm-project?rev=63945&view=rev
> Log:
> first hack at limits.h
>   
> +
> +#define MB_LEN_MAX 1
>   
" maximum number of bytes in a multibyte character, for any supported
locale"
Do we have any business defining this? Supported locales are a question
of the C runtime, not the compiler itself. If any supported locale
supports, say, UTF-8, this should be 4.
> +
> +#ifdef __CHAR_UNSIGNED__  /* -funsigned-char */
> +#define CHAR_MIN ((char)0)
>   
Is this correct? C99 5.2.4.2.1 says, "the following shall be replaced by
expressions that have the same type as would an expression that is an
object of the corresponding type converted according to the integer
promotions."
In C, it might not make a difference whether the promotion is already
done (the expression is of type int) or is done on use, but in C++ it
does (overloading), and C++ defines limits.h by reference to the C standard.

Sebastian



More information about the cfe-commits mailing list