All of lore.kernel.org
 help / color / mirror / Atom feed
From: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
To: ceph-devel@vger.kernel.org
Cc: Sage Weil <sage@inktank.com>
Subject: Re: [PATCH 1/2] utime: fix narrowing conversion compiler warning in sleep()
Date: Tue, 29 Jan 2013 12:52:36 +0100	[thread overview]
Message-ID: <5107B804.5020306@bisect.de> (raw)
In-Reply-To: <1359320252-2445-2-git-send-email-danny.al-gaaf@bisect.de>

Hi,

could someone cherry-pick this patch to the bobtail branch? I see the
same issue there.

Thanks!

Danny


Am 27.01.2013 21:57, schrieb Danny Al-Gaaf:
> Fix compiler warning:
> ./include/utime.h: In member function 'void utime_t::sleep()':
> ./include/utime.h:139:50: warning: narrowing conversion of
>  '((utime_t*)this)->utime_t::tv.utime_t::<anonymous struct>::tv_sec' from
>  '__u32 {aka unsigned int}' to '__time_t {aka long int}' inside { } is
>  ill-formed in C++11 [-Wnarrowing]
> ./include/utime.h:139:50: warning: narrowing conversion of
>  '((utime_t*)this)->utime_t::tv.utime_t::<anonymous struct>::tv_nsec' from
>  '__u32 {aka unsigned int}' to 'long int' inside { } is
>  ill-formed in C++11 [-Wnarrowing]
> 
> Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
> ---
>  src/include/utime.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/include/utime.h b/src/include/utime.h
> index 526dec5..f433fff 100644
> --- a/src/include/utime.h
> +++ b/src/include/utime.h
> @@ -136,7 +136,7 @@ public:
>    }
>  
>    void sleep() {
> -    struct timespec ts = { tv.tv_sec, tv.tv_nsec };
> +    struct timespec ts = { (__time_t)tv.tv_sec, (long)tv.tv_nsec };
>      nanosleep(&ts, &ts);
>    }
>  
> 


  reply	other threads:[~2013-01-29 11:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-27 20:57 [PATCH 0/2] fix some compiler warnings Danny Al-Gaaf
2013-01-27 20:57 ` [PATCH 1/2] utime: fix narrowing conversion compiler warning in sleep() Danny Al-Gaaf
2013-01-29 11:52   ` Danny Al-Gaaf [this message]
2013-01-29 20:34     ` Sage Weil
2013-01-27 20:57 ` [PATCH 2/2] rbd: don't ignore return value of system() Danny Al-Gaaf
2013-01-28 18:47 ` [PATCH 0/2] fix some compiler warnings Dan Mick
2013-01-28 23:23 ` Dan Mick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5107B804.5020306@bisect.de \
    --to=danny.al-gaaf@bisect.de \
    --cc=ceph-devel@vger.kernel.org \
    --cc=sage@inktank.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.