[cfe-dev] WString-plus-int

Eli Friedman eli.friedman at gmail.com
Sun Aug 5 23:50:59 PDT 2012


On Sun, Aug 5, 2012 at 11:41 PM, Devchandra L Meetei <dlmeetei at gmail.com> wrote:
> The following is really a bug in the code. But I am unable to understand how
> array indexing can silence this.
>
> An explanation would help.
>
> note: use array indexing to silence this warning
>                         "ProtocolIFType == " +  _pift );
>                                              ^
>                         &                    [       ]

The suggestion is to rewrite it as '&"ProtocolIFType == "[_pift]'
(i.e. taking the address of a character in the string).  Granted, the
compiler's output isn't as clear as it could be.

-Eli



More information about the cfe-dev mailing list