[Ocfs2-tools-devel] [PATCH] Fix compilation warnings in ocfs2_controld

Sunil Mushran sunil.mushran at oracle.com
Fri Feb 24 09:57:58 PST 2012


Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>

On 02/24/2012 09:50 AM, Goldwyn Rodrigues wrote:
> main.c: In function ‘checkpoint_to_proto_version’:
> main.c:667:3: warning: field precision specifier ‘.*’ expects argument
> of type ‘int’, but argument 7 has type ‘size_t’
> main.c:675:3: warning: field precision specifier ‘.*’ expects argument
> of type ‘int’, but argument 7 has type ‘size_t’
>
> ckpt.c: In function ‘call_ckpt_open’:
> ckpt.c:167:4: warning: format ‘%llx’ expects argument of type ‘long long
> unsigned int’, but argument 9 has type ‘SaCkptCheckpointHandleT’
> ckpt.c: In function ‘ckpt_section_store’:
> ckpt.c:473:3: warning: format ‘%d’ expects argument of type ‘int’, but
> argument 7 has type ‘size_t’
> ckpt.c: In function ‘setup_ckpt’:
> ckpt.c:614:4: warning: format ‘%llx’ expects argument of type ‘long long
> unsigned int’, but argument 7 has type ‘SaCkptHandleT’
>
> Signed-off-by: Goldwyn Rodrigues<rgoldwyn at suse.de>
> ---
>   ocfs2_controld/ckpt.c |    6 +++---
>   ocfs2_controld/main.c |    4 ++--
>   2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/ocfs2_controld/ckpt.c b/ocfs2_controld/ckpt.c
> index 678eeeb..a227557 100644
> --- a/ocfs2_controld/ckpt.c
> +++ b/ocfs2_controld/ckpt.c
> @@ -167,7 +167,7 @@ static int call_ckpt_open(struct ckpt_handle
> *handle, int write)
>   			log_debug("Opened checkpoint \"%.*s\" with handle 0x%llx",
>   				  handle->ch_name.length,
>   				  handle->ch_name.value,
> -				  handle->ch_handle);
> +				  (unsigned long long)handle->ch_handle);
>   			break;
>   		}
>   		if ((rc != -EAGAIN)&&
> @@ -470,7 +470,7 @@ int ckpt_section_store(struct ckpt_handle *handle,
> const char *section,
>   		return -EINVAL;
>   	}
>   	if (data_len>  CKPT_MAX_SECTION_SIZE) {
> -		log_error("Error: attempt to store %d bytes in a section "
> +		log_error("Error: attempt to store %lu bytes in a section "
>   			  "(max is %d)",
>   			  data_len, CKPT_MAX_SECTION_SIZE);
>   		return -EINVAL;
> @@ -612,7 +612,7 @@ int setup_ckpt(void)
>   		ais_err_to_errno(error,&rc,&reason);
>   		if (!rc) {
>   			log_debug("Connected to CKPT service with handle 0x%llx",
> -				  daemon_handle);
> +				  (unsigned long long)daemon_handle);
>   			break;
>   		}
>   		if (rc != -EAGAIN) {
> diff --git a/ocfs2_controld/main.c b/ocfs2_controld/main.c
> index 8b7662b..e038b3d 100644
> --- a/ocfs2_controld/main.c
> +++ b/ocfs2_controld/main.c
> @@ -666,7 +666,7 @@ static int checkpoint_to_proto_version(char *data,
> size_t data_len,
>   	if (data_len != sizeof(struct proto_version_str)) {
>   		log_error("Protocol version string \"%.*s\" has incorrect "
>   			  "length",
> -			  data_len, data);
> +			  (int)data_len, data);
>   		return -EINVAL;
>   	}
>   	memcpy((char *)&str, data, data_len);
> @@ -674,7 +674,7 @@ static int checkpoint_to_proto_version(char *data,
> size_t data_len,
>   	if ((str.space != ' ') || (str.null != '\0')) {
>   		log_error("Protocol version string \"%.*s\" has invalid "
>   			  "separators",
> -			  data_len, data);
> +			  (int)data_len, data);
>   		return -EINVAL;
>   	}
>   	str.space = '\0';



More information about the Ocfs2-tools-devel mailing list