Skip to content

Commit

Permalink
Issue#353: attempt to fix or ignore a few -Wdocumentation messages fr…
Browse files Browse the repository at this point in the history
…om Clang.
  • Loading branch information
hawicz committed Sep 8, 2017
1 parent edde8ef commit 4ac47a0
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions json_object.h
Expand Up @@ -15,6 +15,8 @@

#ifdef __GNUC__
#define THIS_FUNCTION_IS_DEPRECATED(func) func __attribute__ ((deprecated))
#elif defined(__clang__)
#define THIS_FUNCTION_IS_DEPRECATED(func) func __deprecated
#elif defined(_MSC_VER)
#define THIS_FUNCTION_IS_DEPRECATED(func) __declspec(deprecated) func
#else
Expand Down Expand Up @@ -326,6 +328,16 @@ JSON_EXPORT void json_object_set_serializer(json_object *jso,
void *userdata,
json_object_delete_fn *user_delete);

#ifdef __clang__
/*
* Clang doesn't pay attention to the parameters defined in the
* function typedefs used here, so turn off spurious doc warnings.
* {
*/
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
#endif

/**
* Simply call free on the userdata pointer.
* Can be used with json_object_set_serializer().
Expand All @@ -346,6 +358,11 @@ json_object_delete_fn json_object_free_userdata;
*/
json_object_to_json_string_fn json_object_userdata_to_json_string;

#ifdef __clang__
/* } */
#pragma clang diagnostic pop
#endif


/* object type methods */

Expand Down Expand Up @@ -413,6 +430,7 @@ JSON_EXPORT int json_object_object_add_ex(struct json_object* obj,
const unsigned opts);

/** Get the json_object associate with a given object field.
* Deprecated/discouraged: used json_object_object_get_ex instead.
*
* This returns NULL if the field is found but its value is null, or if
* the field is not found, or if obj is not a json_type_object. If you
Expand All @@ -431,7 +449,6 @@ JSON_EXPORT int json_object_object_add_ex(struct json_object* obj,
* @param obj the json_object instance
* @param key the object field name
* @returns the json_object associated with the given field name
* @deprecated Please use json_object_object_get_ex
*/
JSON_EXPORT struct json_object* json_object_object_get(const struct json_object* obj,
const char *key);
Expand Down Expand Up @@ -545,7 +562,7 @@ JSON_EXPORT size_t json_object_array_length(const struct json_object *obj);
* Pointers to the json_object pointers will be passed as the two arguments
* to @sort_fn
*
* @param obj the json_object instance
* @param jso the json_object instance
* @param sort_fn a sorting function
*/
JSON_EXPORT void json_object_array_sort(struct json_object *jso, int(*sort_fn)(const void *, const void *));
Expand Down

0 comments on commit 4ac47a0

Please sign in to comment.