RE: gcc warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>My recommendation is to simply not assign across types unless you have 
>to.  If you have a function like
>
>void myfunc(unsigned long somevalue)
>{
>}
>
>Then never store somevalue in anything but an unsigned long unless 
>you're sure of what you are doing.  Why would you write
>
>char careless = somevalue;
>
>just for the hell of it? 
>
>Tom

I fully understand with you Tom. I don't want to write this 'correct'
code, but problem is that it is easy to make this constructs
inadvertently. And IMHO this is place for compiler to report warning
'Here you overlook something'.

Because there is no reason do these things I think that warning is good
solution. And if someone want to use these language properties without
warning, it may be possible to use explicit cast to smaller type to
suppress warning (that is correct because there is evidence that user
knows about his doing).

Thanks, Jiri Humpolicek


This e-mail and any attachment is for authorised use by the intended recipient(s) only. This email contains confidential information. It should not be copied, disclosed to, retained or used by, any party other than the intended recipient. Any unauthorised distribution, dissemination or copying of this E-mail or its attachments, and/or any use of any information contained in them, is strictly prohibited and may be illegal. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender directly via email. Any emails that you send to us may be monitored by systems or persons other than the named communicant for the purposes of ascertaining whether the communication complies with the law and company policies.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux