r207483 - Revert r207482; I fail at reading IRC.

Nico Weber nicolasweber at gmx.de
Mon Apr 28 18:25:49 PDT 2014


Author: nico
Date: Mon Apr 28 20:25:49 2014
New Revision: 207483

URL: http://llvm.org/viewvc/llvm-project?rev=207483&view=rev
Log:
Revert r207482; I fail at reading IRC.

Removed:
    cfe/trunk/test/Headers/needsnull.cpp
Modified:
    cfe/trunk/lib/Headers/stddef.h

Modified: cfe/trunk/lib/Headers/stddef.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/stddef.h?rev=207483&r1=207482&r2=207483&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/stddef.h (original)
+++ cfe/trunk/lib/Headers/stddef.h Mon Apr 28 20:25:49 2014
@@ -76,7 +76,6 @@ typedef __WCHAR_TYPE__ wchar_t;
 #else
 #  define NULL ((void*)0)
 #endif
-#undef __need_NULL
 
 #ifdef __cplusplus
 #if defined(_MSC_EXTENSIONS) && defined(_NATIVE_NULLPTR_SUPPORTED)
@@ -103,21 +102,6 @@ typedef double max_align_t;
 
 #endif /* __STDDEF_H */
 
-/* Some C libraries set __need_NULL and expects NULL to be defined again. */
-#if defined(__need_NULL)
-#undef NULL
-#ifdef __cplusplus
-#  if !defined(__MINGW32__) && !defined(_MSC_VER)
-#    define NULL __null
-#  else
-#    define NULL 0
-#  endif
-#else
-#  define NULL ((void*)0)
-#endif
-#undef __need_NULL
-#endif
-
 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
 __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
 #if defined(__need_wint_t)

Removed: cfe/trunk/test/Headers/needsnull.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Headers/needsnull.cpp?rev=207482&view=auto
==============================================================================
--- cfe/trunk/test/Headers/needsnull.cpp (original)
+++ cfe/trunk/test/Headers/needsnull.cpp (removed)
@@ -1,20 +0,0 @@
-// RUN: %clang_cc1 -fsyntax-only -triple i386-linux-gnu -verify -Wsentinel %s
-// expected-no-diagnostics
-
-#include <stddef.h>
-
-// linux/stddef.h does something like this for cpp files:
-#undef NULL
-#define NULL 0
-
-// glibc (and other) headers then define __need_NULL and rely on stddef.h
-// to redefine NULL to the correct value again.
-#define __need_NULL
-#include <stddef.h>
-
-// gtk headers then use __attribute__((sentinel)), which doesn't work if NULL
-// is 0.
-void f(const char* c, ...) __attribute__((sentinel));
-void g() {
-  f("", NULL);  // Shouldn't warn.
-}





More information about the cfe-commits mailing list