Unit tests for formatting code, fix %%.

Also fix <signal.h> and <stdio.h> so they don't cause compiler warnings.

Change-Id: Ib1a746bf01de22d47dbd964de0e6af80a7c96303
This commit is contained in:
Elliott Hughes
2013-01-28 10:36:31 -08:00
parent 0a91b11d28
commit 41b3179c9e
5 changed files with 183 additions and 156 deletions

View File

@@ -523,13 +523,13 @@ char *fgets(char *dest, int size, FILE *stream)
// Compiler can prove, at compile time, that the passed in size
// is always <= the actual object size. Don't call __fgets_chk
if (__builtin_constant_p(size) && (size <= bos)) {
if (__builtin_constant_p(size) && (size <= (int) bos)) {
return __fgets_real(dest, size, stream);
}
// Compiler can prove, at compile time, that the passed in size
// is always > the actual object size. Force a compiler error.
if (__builtin_constant_p(size) && (size > bos)) {
if (__builtin_constant_p(size) && (size > (int) bos)) {
__fgets_too_big_error();
}