<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Nov 14, 2014 at 2:08 PM, Prathamesh Kulkarni <span dir="ltr"><<a href="mailto:bilbotheelffriend@gmail.com" target="_blank">bilbotheelffriend@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It appears diagnostic for assignment from void * is also missed.<br></blockquote><div><br></div><div>Please report this and any other cases on the bug; messages here are likely to be forgotten about.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Test-case:<br>
int main(void)<br>
{<br>
  void *q = 0;<br>
  int *p;<br>
  p = q;<br>
  return 0;<br>
}<br>
<br>
gcc -fsyntax-only -Wc++-compat prints:<br>
void-ptr-cast.c:5:5: warning: request for implicit conversion from<br>
‘void *’ to ‘int *’ not permitted in C++ [-Wc++-compat]<br>
   p = q;<br>
     ^<br>
<br>
Thank you,<br>
Prathamesh<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
On Tue, Nov 11, 2014 at 9:07 AM, Richard Smith <<a href="mailto:richard@metafoo.co.uk">richard@metafoo.co.uk</a>> wrote:<br>
> Filed as <a href="http://llvm.org/PR21524" target="_blank">llvm.org/PR21524</a><br>
><br>
> On Mon, Nov 10, 2014 at 4:16 AM, Prathamesh Kulkarni<br>
> <<a href="mailto:bilbotheelffriend@gmail.com">bilbotheelffriend@gmail.com</a>> wrote:<br>
>><br>
>> Hi,<br>
>>   clang doesn't print warning for following test-case:<br>
>> compiled with: clang -fsyntax-only -Wc++-compat<br>
>><br>
>> int new;<br>
>> struct A<br>
>> {<br>
>>   struct B<br>
>>   {<br>
>>     int x;<br>
>>   }bs;<br>
>>   int y;<br>
>> };<br>
>> struct B b;<br>
>><br>
>><br>
>> gcc -fsyntax-only -Wc++-compat prints following warnings (gcc-4.9.1<br>
>> ubuntu):<br>
>><br>
>> t.c:1:5: warning: identifier ‘new’ conflicts with C++ keyword<br>
>> [-Wc++-compat]<br>
>>  int new;<br>
>>       ^<br>
>> t.c:13:8: warning: struct defined in struct or union is not visible in<br>
>> C++ [-Wc++-compat]<br>
>>  struct B b;<br>
>>            ^<br>
>> t.c:5:10: note: struct defined here<br>
>>    struct B<br>
>>              ^<br>
>> clang --version:<br>
>> Ubuntu clang version 3.5.0-4ubuntu2 (tags/RELEASE_350/final) (based on<br>
>> LLVM 3.5.0)<br>
>> Target: x86_64-pc-linux-gnu<br>
>> Thread model: posix<br>
>><br>
>> Thank you,<br>
>> Prathamesh<br>
>><br>
>> _______________________________________________<br>
>> cfe-dev mailing list<br>
>> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
>> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
><br>
><br>
</div></div></blockquote></div><br></div></div>