Re: shame on MISRA
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Mon, 23 Apr 2007 14:20:53 -0400
Marcin Wolcendorf wrote:
On Mon, 23 Apr 2007 06:47:55 -0700, Robert Adsett wrote:.... snip ...
Marcin Wolcendorf <wolce...@xxxxxxxxxxxxxx> wrote:
Yeah, now I can. It just doesn't matter. If I use ~0U it will
trigger MISRA-C rule 10.1 (An integer constant expression with
negative value is
Maybe I'm being exceptionally dense this morning but What integer
constant expression with a negative value?
Well, having ~0U is not quite enough; I want to use it :). So I
did: uint16_t some_variable = (uint16_t)(~0U);
(effectively- all #defines, ...) to have 0xffff in some_variable.
It was enough to trigger the rule.
Ignoring Misra, that is not as accurate as "unsigned = -1", which
will set all bits to one everywhere.
--
<http://www.cs.auckland.ac.nz/~pgut001/pubs/vista_cost.txt>
<http://www.securityfocus.com/columnists/423>
<http://www.aaxnet.com/editor/edit043.html>
cbfalconer at maineline.net
--
Posted via a free Usenet account from http://www.teranews.com
.
- Follow-Ups:
- Re: shame on MISRA
- From: Yuriy
- Re: shame on MISRA
- From: Robert Adsett
- Re: shame on MISRA
- From: Marcin Wolcendorf
- Re: shame on MISRA
- References:
- Re: shame on MISRA
- From: Marcin Wolcendorf
- Re: shame on MISRA
- From: Arlet
- Re: shame on MISRA
- From: Marcin Wolcendorf
- Re: shame on MISRA
- From: Marcin Wolcendorf
- Re: shame on MISRA
- From: Robert Adsett
- Re: shame on MISRA
- From: Marcin Wolcendorf
- Re: shame on MISRA
- Prev by Date: Re: Semi-OT: Killing RFID credit card?
- Next by Date: Re: Question about strange flash problem
- Previous by thread: Re: shame on MISRA
- Next by thread: Re: shame on MISRA
- Index(es):
Relevant Pages
|