Re: shame on MISRA



On Sun, 22 Apr 2007 08:58:18 -0700, Arlet wrote:

On Apr 22, 12:44 pm, Marcin Wolcendorf <wolce...@xxxxxxxxxxxxxx>
wrote:

No. It doesn't. One of the rules states (I don't have them in front of me),
that you can't use signed constants (like -1U) to set unsigned variables. -1U
is a nice value of all 1s binary, convenient for masking. Well, you can get
....

Just use ~0U

True :).
I can't recall the reason, why I didn't use it.

M.
.



Relevant Pages

  • Re: shame on MISRA
    ... that you can't use signed constants to set unsigned variables. ... is a nice value of all 1s binary, convenient for masking. ... I sometimes use 0xFFFFffff which is with a constant width font quite ...
    (comp.arch.embedded)
  • Re: shame on MISRA
    ... On Apr 22, 12:44 pm, Marcin Wolcendorf ... that you can't use signed constants to set unsigned variables. ... Now, both ways are clumsy, hard to read and look like a dirty hack IMHO. ...
    (comp.arch.embedded)