alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Clemens Ladisch <clemens@ladisch.de>,
	Michel Normand <normand@linux.vnet.ibm.com>,
	alsa-devel@alsa-project.org
Subject: Re: [PATCH] gcc6 narrowing error
Date: Tue, 21 Jun 2016 16:16:02 +0200	[thread overview]
Message-ID: <57694C22.7060000@metafoo.de> (raw)
In-Reply-To: <53bac5ad-0ae4-5317-752f-ec8182a9796e@ladisch.de>

On 06/21/2016 01:21 PM, Clemens Ladisch wrote:
> Michel Normand wrote:
>> [   51s] Cus428Midi.cc:83:1: error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]
>>
>> -	-1, -1, -1, -1, -1, -1
>> +	(char)-1, (char)-1, (char)-1, (char)-1, (char)-1, (char)-1
> 
> The warning is wrong, because the value is a constant that fits into the
> narrower type.

Not if char is unsigned char, which it is on some platforms. Best is
probably to mark the array as explicitly signed or unsigned otherwise these
warnings will appear on one or the other platform.

  reply	other threads:[~2016-06-21 14:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20  8:10 [PATCH] gcc6 reporting error building alsa-tools on PowerPC Michel Normand
2016-06-20  8:10 ` [PATCH] gcc6 narrowing error Michel Normand
2016-06-21 11:21   ` Clemens Ladisch
2016-06-21 14:16     ` Lars-Peter Clausen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-06-20 13:26 [PATCH] alsa-tools " Michel Normand
2016-06-20 13:26 ` [PATCH] " Michel Normand
2016-06-20 13:43   ` Takashi Iwai

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=57694C22.7060000@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=normand@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).