[cfe-commits] r142345 - /cfe/trunk/test/Sema/format-strings-fixit.c

Ted Kremenek kremenek at apple.com
Tue Oct 18 12:05:12 PDT 2011


Hi Hans,

Instead of disabling the test for ssize_t outright, please move that specific case to a separate test source file and pass a specific -cc1 target triple for the test.  We should not remove test coverage for this case.

Thanks,
Ted

On Oct 18, 2011, at 1:58 AM, Hans Wennborg wrote:

> Author: hans
> Date: Tue Oct 18 03:58:16 2011
> New Revision: 142345
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=142345&view=rev
> Log:
> Disable the ssize_t test in format-strings-fixit.c.
> 
> 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.
> 
> Modified:
>    cfe/trunk/test/Sema/format-strings-fixit.c
> 
> Modified: cfe/trunk/test/Sema/format-strings-fixit.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/format-strings-fixit.c?rev=142345&r1=142344&r2=142345&view=diff
> ==============================================================================
> --- cfe/trunk/test/Sema/format-strings-fixit.c (original)
> +++ cfe/trunk/test/Sema/format-strings-fixit.c Tue Oct 18 03:58:16 2011
> @@ -48,14 +48,14 @@
>   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 @@
> // 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);
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list