[Ocfs2-test-devel] [PATCH 1/2] Fix compiler warning that types don't match

Junxiao Bi junxiao.bi at oracle.com
Thu Oct 8 23:40:30 PDT 2015


On 10/09/2015 10:08 AM, zren at suse.com wrote:
> From: Eric Ren <zren at suse.com>
> 
> check_file_size_limits.c: In function ‘main’:
> check_file_size_limits.c:231:2: warning: pointer targets in passing argument 3 of ‘parse_opts’ differ in signedness [-Wpointer-sign]
>   if (parse_opts(argc, argv, &bbits, &cbits, &fname)) {
>   ^
> check_file_size_limits.c:112:12: note: expected ‘unsigned int *’ but argument is of type ‘int *’
>  static int parse_opts(int argc, char **argv, unsigned int *bbits,
>             ^
> check_file_size_limits.c:231:2: warning: pointer targets in passing argument 4 of ‘parse_opts’ differ in signedness [-Wpointer-sign]
>   if (parse_opts(argc, argv, &bbits, &cbits, &fname)) {
>   ^
> check_file_size_limits.c:112:12: note: expected ‘unsigned int *’ but argument is of type ‘int *’
>  static int parse_opts(int argc, char **argv, unsigned int *bbits,
>             ^
> 
> Signed-off-by: Eric Ren <zren at suse.com>
Reviewed-by: Junxiao Bi <junxiao.bi at oracle.com>
> ---
>  programs/check_file_size_limits/check_file_size_limits.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/programs/check_file_size_limits/check_file_size_limits.c b/programs/check_file_size_limits/check_file_size_limits.c
> index c8a1e43..dfd438a 100644
> --- a/programs/check_file_size_limits/check_file_size_limits.c
> +++ b/programs/check_file_size_limits/check_file_size_limits.c
> @@ -220,7 +220,7 @@ static int write_at_largest_off(int fd, unsigned long long max_off)
>  int main(int argc, char **argv)
>  {
>  	int fd, ret;
> -	int bbits = 0, cbits = 0;
> +	unsigned int bbits = 0, cbits = 0;
>  	char *fname = NULL;
>  	unsigned long long max_off;
>  
> 




More information about the Ocfs2-test-devel mailing list