]> granicus.if.org Git - clang/commitdiff
Disable the ssize_t test in format-strings-fixit.c.
authorHans Wennborg <hans@hanshq.net>
Tue, 18 Oct 2011 08:58:16 +0000 (08:58 +0000)
committerHans Wennborg <hans@hanshq.net>
Tue, 18 Oct 2011 08:58:16 +0000 (08:58 +0000)
Turns out this part of the test from r142342 wasn't portable.
The errors on the bots look like this:

E:\bb-win7\cmake-clang-i686-msys\build\tools\clang\test\Sema\Output\format-strings-fixit.c.tmp:58:13: error: conversion specifies type 'unsigned int' but the argument has type 'ssize_t' (aka 'long')
  printf("%zd", (ssize_t) 42);
          ~~^   ~~~~~~~~~~~~
          %zd

Obviously we can't typedef ssize_t to someting that doesn't have the same size as size_t and expect it to work.

But it's also weird that the format string "%zd" gets interpreted as "unsigned int" when it should clearly be signed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142345 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/format-strings-fixit.c

index 5b2f54a59fae73a9ed430fead9dd9dc207330b09..590b2f32f5318a9f34389c13e95890e79056472d 100644 (file)
@@ -48,14 +48,14 @@ void test() {
   printf("%X", val);
 
   typedef __SIZE_TYPE__ size_t;
-  typedef signed long int ssize_t;
+  typedef signed long int ssize_t; // FIXME: Figure out the right typedef.
   typedef __INTMAX_TYPE__ intmax_t;
   typedef __UINTMAX_TYPE__ uintmax_t;
   typedef __PTRDIFF_TYPE__ ptrdiff_t;
 
   // size_t, etc.
   printf("%c", (size_t) 42);
-  printf("%c", (ssize_t) 42);
+  //printf("%c", (ssize_t) 42);
   printf("%c", (intmax_t) 42);
   printf("%c", (uintmax_t) 42);
   printf("%c", (ptrdiff_t) 42);
@@ -82,7 +82,6 @@ void test() {
 // CHECK: printf("%1$p", (void *)0);
 // CHECK: printf("%lX", val);
 // CHECK: printf("%zu", (size_t) 42);
-// CHECK: printf("%zd", (ssize_t) 42);
 // CHECK: printf("%jd", (intmax_t) 42);
 // CHECK: printf("%ju", (uintmax_t) 42);
 // CHECK: printf("%td", (ptrdiff_t) 42);