Commit d64b36b8 authored by Gabriel Russo's avatar Gabriel Russo Committed by Facebook Github Bot

Ignore `-Wnullability-extension` in FOLLY_NULLABLE

Summary:
clang has the warning `-Wnullability-extension` to avoid unportable code. Folly correctly handles it, so let's
ignore the warning if it is set.

(Note: this ignores all push blocking failures!)

Reviewed By: stepancheg

Differential Revision: D19580470

fbshipit-source-id: 59ddb5377a98d907a62df5d480b1ea0a65645a6b
parent 06d2acdf
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#pragma once #pragma once
#include <folly/Portability.h>
#ifndef __has_attribute #ifndef __has_attribute
#define FOLLY_HAS_ATTRIBUTE(x) 0 #define FOLLY_HAS_ATTRIBUTE(x) 0
#else #else
...@@ -99,10 +101,19 @@ ...@@ -99,10 +101,19 @@
* } * }
* return nullptr; * return nullptr;
* } * }
*
* Ignores Clang's -Wnullability-extension since it correctly handles the case
* where the extension is not present.
*/ */
#if FOLLY_HAS_EXTENSION(nullability) #if FOLLY_HAS_EXTENSION(nullability)
#define FOLLY_NULLABLE _Nullable #define FOLLY_NULLABLE \
#define FOLLY_NONNULL _Nonnull FOLLY_PUSH_WARNING \
FOLLY_CLANG_DISABLE_WARNING("-Wnullability-extension") \
_Nullable FOLLY_POP_WARNING
#define FOLLY_NONNULL \
FOLLY_PUSH_WARNING \
FOLLY_CLANG_DISABLE_WARNING("-Wnullability-extension") \
_Nonnull FOLLY_POP_WARNING
#else #else
#define FOLLY_NULLABLE #define FOLLY_NULLABLE
#define FOLLY_NONNULL #define FOLLY_NONNULL
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment