r175681 - Revert "intmax_t is long long on Darwin, not long."

Hal Finkel hfinkel at anl.gov
Wed Feb 20 14:42:51 PST 2013


----- Original Message -----
> From: "Jordan Rose" <jordan_rose at apple.com>
> To: cfe-commits at cs.uiuc.edu
> Sent: Wednesday, February 20, 2013 4:28:41 PM
> Subject: r175681 - Revert "intmax_t is long long on Darwin, not long."
> 
> Author: jrose
> Date: Wed Feb 20 16:28:41 2013
> New Revision: 175681
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=175681&view=rev
> Log:
> Revert "intmax_t is long long on Darwin, not long."
> 
> 'long' and 'long long' are different for the purposes of mangling.
> This caused <rdar://problem/13254874>.

Can you please explain this? I understand the name-mangling difference, but if long long is larger than long, then intmax_t needs to be long long, no?

 -Hal

> 
> This reverts commit c2f994d31ec85e9af811af38eb1b28709aef0b2c.
> 
> Modified:
>     cfe/trunk/lib/Basic/Targets.cpp
>     cfe/trunk/test/FixIt/format-darwin.m
>     cfe/trunk/test/Sema/format-strings-size_t.c
> 
> Modified: cfe/trunk/lib/Basic/Targets.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=175681&r1=175680&r2=175681&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Basic/Targets.cpp (original)
> +++ cfe/trunk/lib/Basic/Targets.cpp Wed Feb 20 16:28:41 2013
> @@ -3119,8 +3119,6 @@ class DarwinX86_64TargetInfo : public Da
>  public:
>    DarwinX86_64TargetInfo(const std::string& triple)
>        : DarwinTargetInfo<X86_64TargetInfo>(triple) {
> -    IntMaxType = SignedLongLong;
> -    UIntMaxType = UnsignedLongLong;
>      Int64Type = SignedLongLong;
>      MaxVectorAlign = 256;
>    }
> 
> Modified: cfe/trunk/test/FixIt/format-darwin.m
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/FixIt/format-darwin.m?rev=175681&r1=175680&r2=175681&view=diff
> ==============================================================================
> --- cfe/trunk/test/FixIt/format-darwin.m (original)
> +++ cfe/trunk/test/FixIt/format-darwin.m Wed Feb 20 16:28:41 2013
> @@ -21,7 +21,6 @@ typedef int NSInteger;
>  typedef unsigned int NSUInteger;
>  typedef long SInt32;
>  typedef unsigned long UInt32;
> -
>  #endif
>  
>  NSInteger getNSInteger();
> @@ -211,25 +210,3 @@ void testCapitals() {
>    // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:13-[[@LINE-3]]:14}:"d"
>    // CHECK: fix-it:"{{.*}}":{[[@LINE-4]]:11-[[@LINE-4]]:14}:"%D"
>  }
> -
> -
> -// The OS X headers do not always use __INTMAX_TYPE__ and friends.
> -typedef long long intmax_t;
> -typedef unsigned long long uintmax_t;
> -#define INTMAX_C(X) (X ## LL)
> -#define UINTMAX_C(X) (X ## ULL)
> -
> -void testIntMax(intmax_t i, uintmax_t u) {
> -  printf("%d", i); // expected-warning{{format specifies type 'int'
> but the argument has type 'intmax_t' (aka 'long long')}}
> -  printf("%d", u); // expected-warning{{format specifies type 'int'
> but the argument has type 'uintmax_t' (aka 'unsigned long long')}}
> -
> -  // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:11-[[@LINE-3]]:13}:"%jd"
> -  // CHECK: fix-it:"{{.*}}":{[[@LINE-3]]:11-[[@LINE-3]]:13}:"%ju"
> -
> -  printf("%jd", i); // no-warning
> -  printf("%ju", u); // no-warning
> -
> -  printf("%jd", INTMAX_C(5)); // no-warning
> -  printf("%ju", INTMAX_C(5)); // no-warning
> -}
> -
> 
> Modified: cfe/trunk/test/Sema/format-strings-size_t.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/format-strings-size_t.c?rev=175681&r1=175680&r2=175681&view=diff
> ==============================================================================
> --- cfe/trunk/test/Sema/format-strings-size_t.c (original)
> +++ cfe/trunk/test/Sema/format-strings-size_t.c Wed Feb 20 16:28:41
> 2013
> @@ -1,4 +1,4 @@
> -// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fsyntax-only
> -verify %s
> +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only
> -verify %s
>  
>  int printf(char const *, ...);
>  
> 
> 
> _______________________________________________
> 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