- Further attributes mainly for opal/* functions, marking
__opal_attribute_nonnull__, __opal_attribute_warn_unused_result__, __opal_attribute_malloc__, __opal_attribute_sentinel__ and __opal_attribute_format__ This commit was SVN r14078.
Этот коммит содержится в:
родитель
d67565b042
Коммит
1322f9f346
@ -72,7 +72,7 @@ OPAL_DECLSPEC int opal_free_list_init(
|
||||
int max_elements_to_alloc,
|
||||
int num_elements_per_alloc);
|
||||
|
||||
OPAL_DECLSPEC int opal_free_list_grow(opal_free_list_t* flist, size_t num_elements);
|
||||
OPAL_DECLSPEC int opal_free_list_grow(opal_free_list_t* flist, size_t num_elements) __opal_attribute_nonnull__(1);
|
||||
|
||||
/**
|
||||
* Attemp to obtain an item from a free list.
|
||||
|
@ -63,7 +63,7 @@ extern "C" {
|
||||
* value into the argv array; there is no need to keep the original
|
||||
* string (i.e., the arg parameter) after invoking this function.
|
||||
*/
|
||||
OPAL_DECLSPEC int opal_argv_append(int *argc, char ***argv, const char *arg);
|
||||
OPAL_DECLSPEC int opal_argv_append(int *argc, char ***argv, const char *arg) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(3);
|
||||
|
||||
/**
|
||||
* Append to an argv-style array, but ignore the size of the array.
|
||||
@ -111,7 +111,7 @@ OPAL_DECLSPEC void opal_argv_free(char **argv);
|
||||
* argument (i.e., it can be freed after calling this function
|
||||
* without invalidating the output argv).
|
||||
*/
|
||||
OPAL_DECLSPEC char **opal_argv_split(const char *src_string, int delimiter);
|
||||
OPAL_DECLSPEC char **opal_argv_split(const char *src_string, int delimiter) __opal_attribute_nonnull__(1) __opal_attribute_warn_unused_result__;
|
||||
|
||||
/**
|
||||
* Return the length of a NULL-terminated argv array.
|
||||
@ -141,7 +141,7 @@ OPAL_DECLSPEC int opal_argv_count(char **argv);
|
||||
*
|
||||
* It is the callers responsibility to free the returned string.
|
||||
*/
|
||||
OPAL_DECLSPEC char *opal_argv_join(char **argv, int delimiter);
|
||||
OPAL_DECLSPEC char *opal_argv_join(char **argv, int delimiter) __opal_attribute_malloc__;
|
||||
|
||||
/**
|
||||
* Return the number of bytes consumed by an argv array.
|
||||
@ -166,7 +166,7 @@ OPAL_DECLSPEC size_t opal_argv_len(char **argv);
|
||||
* Specifically, the output argv will be an array of the same length
|
||||
* as the input argv, and strcmp(argv_in[i], argv_out[i]) will be 0.
|
||||
*/
|
||||
OPAL_DECLSPEC char **opal_argv_copy(char **argv);
|
||||
OPAL_DECLSPEC char **opal_argv_copy(char **argv) __opal_attribute_malloc__;
|
||||
|
||||
/**
|
||||
* Delete one or more tokens from the middle of an argv.
|
||||
|
@ -29,7 +29,6 @@
|
||||
#include "opal/threads/mutex.h"
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/util/cmd_line.h"
|
||||
#include "opal/util/strncpy.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
#include "opal/constants.h"
|
||||
|
@ -74,7 +74,7 @@ extern "C" {
|
||||
* On platforms where sizeof(size_t) <= sizeof(int), this function
|
||||
* will aways return OPAL_SUCCESS.
|
||||
*/
|
||||
OPAL_DECLSPEC int opal_size2int(size_t in, int *out, bool want_check);
|
||||
OPAL_DECLSPEC int opal_size2int(size_t in, int *out, bool want_check) __opal_attribute_nonnull__(2);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ void opal_malloc_finalize(void);
|
||||
* This function is only used when --enable-mem-debug was specified to
|
||||
* configure (or by default if you're building in a SVN checkout).
|
||||
*/
|
||||
OPAL_DECLSPEC void *opal_malloc(size_t size, const char *file, int line);
|
||||
OPAL_DECLSPEC void *opal_malloc(size_t size, const char *file, int line) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
|
||||
|
||||
/**
|
||||
* \internal
|
||||
@ -98,7 +98,7 @@ OPAL_DECLSPEC void *opal_malloc(size_t size, const char *file, int line);
|
||||
* This function is only used when --enable-mem-debug was specified to
|
||||
* configure (or by default if you're building in a SVN checkout).
|
||||
*/
|
||||
OPAL_DECLSPEC void *opal_calloc(size_t nmembers, size_t size, const char *file, int line);
|
||||
OPAL_DECLSPEC void *opal_calloc(size_t nmembers, size_t size, const char *file, int line) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
|
||||
|
||||
/**
|
||||
* \internal
|
||||
@ -114,7 +114,7 @@ OPAL_DECLSPEC void *opal_calloc(size_t nmembers, size_t size, const char *file,
|
||||
* This function is only used when --enable-mem-debug was specified to
|
||||
* configure (or by default if you're building in a SVN checkout).
|
||||
*/
|
||||
OPAL_DECLSPEC void *opal_realloc(void *ptr, size_t size, const char *file, int line);
|
||||
OPAL_DECLSPEC void *opal_realloc(void *ptr, size_t size, const char *file, int line) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
|
||||
|
||||
/**
|
||||
* \internal
|
||||
@ -130,7 +130,7 @@ OPAL_DECLSPEC void *opal_realloc(void *ptr, size_t size, const char *file, int l
|
||||
* to configure (or by default if you're building in a SVN
|
||||
* checkout).
|
||||
*/
|
||||
OPAL_DECLSPEC void opal_free(void *addr, const char *file, int line);
|
||||
OPAL_DECLSPEC void opal_free(void *addr, const char *file, int line) __opal_attribute_nonnull__(1);
|
||||
|
||||
OPAL_DECLSPEC extern int opal_malloc_debug_level;
|
||||
OPAL_DECLSPEC extern int opal_malloc_output;
|
||||
|
@ -53,14 +53,14 @@ extern "C" {
|
||||
* one of the two is NULL, the other list is simply copied to the
|
||||
* output. If both are NULL, NULL is returned.
|
||||
*/
|
||||
OPAL_DECLSPEC char **opal_environ_merge(char **minor, char **major);
|
||||
OPAL_DECLSPEC char **opal_environ_merge(char **minor, char **major) __opal_attribute_warn_unused_result__;
|
||||
|
||||
/**
|
||||
* Portable version of setenv(3), allowing editing of any
|
||||
* environ-like array.
|
||||
*
|
||||
* @param name String name of the environment variable to look for
|
||||
* @param value String value to set
|
||||
* @param value String value to set (may be NULL)
|
||||
* @param overwrite Whether to overwrite any existing value with
|
||||
* the same name
|
||||
* @param env The environment to use
|
||||
@ -102,7 +102,7 @@ extern "C" {
|
||||
* \endcode
|
||||
*/
|
||||
OPAL_DECLSPEC int opal_setenv(const char *name, const char *value,
|
||||
bool overwrite, char ***env);
|
||||
bool overwrite, char ***env) __opal_attribute_nonnull__(1);
|
||||
|
||||
/**
|
||||
* Portable version of unsetenv(3), allowing editing of any
|
||||
@ -118,7 +118,7 @@ extern "C" {
|
||||
* If \em name is found in \em env, the string corresponding to
|
||||
* that entry is freed and its entry is eliminated from the array.
|
||||
*/
|
||||
OPAL_DECLSPEC int opal_unsetenv(const char *name, char ***env);
|
||||
OPAL_DECLSPEC int opal_unsetenv(const char *name, char ***env) __opal_attribute_nonnull__(1);
|
||||
|
||||
/**
|
||||
* So that others don't have to declare it
|
||||
|
@ -65,7 +65,7 @@ extern "C" {
|
||||
* appropriate to the local operating system. The path_name string has been malloc'd
|
||||
* and therefore the user is responsible for free'ing the field.
|
||||
*/
|
||||
OPAL_DECLSPEC char *opal_os_path(bool relative, ...);
|
||||
OPAL_DECLSPEC char *opal_os_path(bool relative, ...) __opal_attribute_malloc__ __opal_attribute_sentinel__ __opal_attribute_warn_unused_result__;
|
||||
|
||||
/**
|
||||
* Convert the path to be OS friendly. On UNIX this function will
|
||||
|
@ -36,7 +36,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
OPAL_DECLSPEC char *opal_strncpy(char *dest, const char *src, size_t len);
|
||||
/* Might also be pure? */
|
||||
OPAL_DECLSPEC char *opal_strncpy(char *dest, const char *src, size_t len) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2);
|
||||
|
||||
#if defined(c_plusplus) || defined(__cplusplus)
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ ORTE_DECLSPEC int orte_errmgr_base_proc_aborted_not_avail(orte_gpr_notify_mes
|
||||
|
||||
ORTE_DECLSPEC int orte_errmgr_base_incomplete_start_not_avail(orte_gpr_notify_message_t *msg);
|
||||
|
||||
ORTE_DECLSPEC void orte_errmgr_base_error_detected(int error_code, char *fmt, ...);
|
||||
ORTE_DECLSPEC void orte_errmgr_base_error_detected(int error_code, char *fmt, ...) __opal_attribute_format__(__printf__, 2, 3);
|
||||
|
||||
ORTE_DECLSPEC int orte_errmgr_base_register_job_not_avail(orte_jobid_t job);
|
||||
|
||||
|
@ -66,7 +66,7 @@ int orte_errmgr_bproc_proc_aborted(orte_gpr_notify_message_t *msg);
|
||||
|
||||
int orte_errmgr_bproc_incomplete_start(orte_gpr_notify_message_t *msg);
|
||||
|
||||
void orte_errmgr_bproc_error_detected(int error_code, char *fmt, ...);
|
||||
void orte_errmgr_bproc_error_detected(int error_code, char *fmt, ...) __opal_attribute_format__(__printf__, 2, 3);
|
||||
|
||||
void orte_errmgr_bproc_abort(void);
|
||||
|
||||
|
@ -64,7 +64,7 @@ int orte_errmgr_hnp_proc_aborted(orte_gpr_notify_message_t *msg);
|
||||
|
||||
int orte_errmgr_hnp_incomplete_start(orte_gpr_notify_message_t *msg);
|
||||
|
||||
void orte_errmgr_hnp_error_detected(int error_code, char *fmt, ...);
|
||||
void orte_errmgr_hnp_error_detected(int error_code, char *fmt, ...) __opal_attribute_format__(__printf__, 2, 3);
|
||||
|
||||
void orte_errmgr_hnp_abort(void);
|
||||
|
||||
|
@ -66,7 +66,7 @@ int orte_errmgr_orted_proc_aborted(orte_gpr_notify_message_t *msg);
|
||||
|
||||
int orte_errmgr_orted_incomplete_start(orte_gpr_notify_message_t *msg);
|
||||
|
||||
void orte_errmgr_orted_error_detected(int error_code, char *fmt, ...);
|
||||
void orte_errmgr_orted_error_detected(int error_code, char *fmt, ...) __opal_attribute_format__(__printf__, 2, 3);
|
||||
|
||||
void orte_errmgr_orted_abort(void);
|
||||
|
||||
|
@ -66,7 +66,7 @@ int orte_errmgr_proxy_proc_aborted(orte_gpr_notify_message_t *msg);
|
||||
|
||||
int orte_errmgr_proxy_incomplete_start(orte_gpr_notify_message_t *msg);
|
||||
|
||||
void orte_errmgr_proxy_error_detected(int error_code, char *fmt, ...);
|
||||
void orte_errmgr_proxy_error_detected(int error_code, char *fmt, ...) __opal_attribute_format__(__printf__, 2, 3);
|
||||
|
||||
void orte_errmgr_proxy_abort(void);
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user