[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] vasnprintf: silence some clang false positives
From: |
Paul Eggert |
Subject: |
Re: [PATCH] vasnprintf: silence some clang false positives |
Date: |
Thu, 17 Feb 2011 22:42:53 -0800 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 |
>> > Ordinary C "assert (X)" means "crash if X is false".
>> > But sa_assert (X) means "assume that X is true".
>> > These are two very different different things.
> ... for both macros, in the thinking of the programmer, it's an
> assertion: the programmer asserts (that is, guarantees) a certain
> condition. The difference is only to whom he does the assertion:
> to the runtime execution in one case, to the static analysis tool
> in the other case.
I'm afraid it's not that simple, as both macros
can be used by static analysis tools.
Perhaps we'll just have to agree to
disagree about what assert (X) means in C.
To most C programmers, I think assert (X) means
"crash if X is false" (assuming NDEBUG).
The traditional Hoare-logic meaning of "assert"
is a related notion, but it's not the same thing.
I wish the C folks had chosen a different name
for their "assert"....
- [PATCH] vasnprintf: silence some clang false positives, Eric Blake, 2011/02/14
- Re: [PATCH] vasnprintf: silence some clang false positives, Bruno Haible, 2011/02/14
- Re: [PATCH] vasnprintf: silence some clang false positives, Eric Blake, 2011/02/15
- Re: [PATCH] vasnprintf: silence some clang false positives, Paul Eggert, 2011/02/15
- Re: [PATCH] vasnprintf: silence some clang false positives, Ben Pfaff, 2011/02/15
- Re: [PATCH] vasnprintf: silence some clang false positives, Jim Meyering, 2011/02/15
- Re: [PATCH] vasnprintf: silence some clang false positives, Paul Eggert, 2011/02/15
- Re: [PATCH] vasnprintf: silence some clang false positives, Jim Meyering, 2011/02/15
- static analysis assumption (was: Re: [PATCH] vasnprintf: silence some clang false positives), Bruce Korb, 2011/02/15
- Re: [PATCH] vasnprintf: silence some clang false positives, Bruno Haible, 2011/02/17
- Re: [PATCH] vasnprintf: silence some clang false positives,
Paul Eggert <=