Re: char y = 469;

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

 



John Love-Jensen wrote:
> Hi stf_polska,
>
> To get a warning or error for that kind of construct, you need to use a
> language like Ada where that would be a warning/error.
>
> In C and C++, it isn't a warning because it is expected and standard
> practice.
>
> So for C and C++, the way to turn that into a RUNTIME warning is to write an
> IntToChar routine:
>   

But you can't verify your code if you don't know the range of the
inputs, so you'd presumably have some sort of range check before you
started working with the input, in which case it would be limited to
0-127 already (or 0-255 for unsigned char).

I assume we all verify our code right?  :-)

Tom

[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