1
1

- Update the warn_unused result from allocating functions

- Set __opal_attribute_nonnull__ where an argument *must* not be null
 - Mark unused functions

This commit was SVN r19107.
Этот коммит содержится в:
Rainer Keller 2008-07-31 15:46:09 +00:00
родитель 2ee493c3f9
Коммит dbafe83999
3 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -5,7 +5,7 @@
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2008 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
@ -162,9 +162,9 @@ 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_attribute_malloc__;
OPAL_DECLSPEC char *opal_argv_join(char **argv, int delimiter) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
OPAL_DECLSPEC char *opal_argv_join_range(char **argv, size_t start, size_t end, int delimiter) __opal_attribute_malloc__;
OPAL_DECLSPEC char *opal_argv_join_range(char **argv, size_t start, size_t end, int delimiter) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
/**
* Return the number of bytes consumed by an argv array.
@ -189,7 +189,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_attribute_malloc__;
OPAL_DECLSPEC char **opal_argv_copy(char **argv) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
/**
* Delete one or more tokens from the middle of an argv.

Просмотреть файл

@ -130,7 +130,7 @@ static int split_shorts(opal_cmd_line_t *cmd,
int *output_argc, char ***output_argv,
int *num_args_used, bool ignore_unknown);
static cmd_line_option_t *find_option(opal_cmd_line_t *cmd,
const char *option_name);
const char *option_name) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2);
static void set_dest(cmd_line_option_t *option, char *sval);
static void fill(const cmd_line_option_t *a, char result[3][BUFSIZ]);
static int qsort_callback(const void *a, const void *b);

Просмотреть файл

@ -5,7 +5,7 @@
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* Copyright (c) 2004-2007 High Performance Computing Center Stuttgart,
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
@ -416,7 +416,7 @@ extern "C" {
*
* The returned string must be freed by the caller.
*/
OPAL_DECLSPEC char *opal_cmd_line_get_usage_msg(opal_cmd_line_t *cmd);
OPAL_DECLSPEC char *opal_cmd_line_get_usage_msg(opal_cmd_line_t *cmd) __opal_attribute_malloc__ __opal_attribute_warn_unused_result__;
/**
* Test if a given option was taken on the parsed command line.
@ -438,7 +438,7 @@ extern "C" {
* Otherwise, it will return false.
*/
OPAL_DECLSPEC bool opal_cmd_line_is_taken(opal_cmd_line_t *cmd,
const char *opt);
const char *opt) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2);
/**
* Return the number of arguments parsed on a OPAL command line handle.
@ -451,7 +451,7 @@ extern "C" {
* Arguments are added to the handle via the opal_cmd_line_parse()
* function.
*/
OPAL_DECLSPEC int opal_cmd_line_get_argc(opal_cmd_line_t *cmd);
OPAL_DECLSPEC int opal_cmd_line_get_argc(opal_cmd_line_t *cmd) __opal_attribute_unused__;
/**
* Return a string argument parsed on a OPAL command line handle.
@ -494,7 +494,7 @@ extern "C" {
* handle, or opal_cmd_line_parse() was not invoked on this handle.
*/
OPAL_DECLSPEC int opal_cmd_line_get_ninsts(opal_cmd_line_t *cmd,
const char *opt);
const char *opt) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2);
/**
* Return a specific parameter for a specific instance of a option
@ -556,7 +556,7 @@ extern "C" {
* to opal_argv_free()) by the caller.
*/
OPAL_DECLSPEC int opal_cmd_line_get_tail(opal_cmd_line_t *cmd, int *tailc,
char ***tailv);
char ***tailv) __opal_attribute_nonnull__(1) __opal_attribute_nonnull__(2);
#if defined(c_plusplus) || defined(__cplusplus)
}