RAD Studio |  |

W8041: Negating unsigned value (C++)
Example
Collapse All

(Command-line option to suppress warning: -w-ngu)

Basically, it makes no sense to negate an unsigned value because the result will still be unsigned.

Example
Copy Code

    #pragma warn +ngu
    unsignedfoo(unsigned u)
    {
    return-u;
    }

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!