View mode: basic / threaded / horizontal-split · Log in · Help
May 06, 2011
Re: Patterns of Human Error - my presentation at the DC ACM
On 5/6/2011 1:46 PM, Brad Roberts wrote:
> That was the first error I caught.. since I've seen you use it as a common
> error and reason to use foreach() style loops before.

Interestingly, nobody saw all 5 bugs.
May 06, 2011
Re: Patterns of Human Error - my presentation at the DC ACM
Walter:

> Interestingly, nobody saw all 5 bugs.

A good C lint has caught three of them, plus gives an extra suggestion:

    8      for (i = 0; i <= dim; i++);
diy.c  8  Warning 574:  Signed-unsigned mix with relational
diy.c  8  Info 737:  Loss of sign in promotion from int to unsigned int
diy.c  8  Info 722:  Suspicious use of ;

   14  }
diy.c  14  Warning 533:  function 'find(long *, unsigned int, long)' should return a value (see line 6)
diy.c  14  Info 818:  Pointer parameter 'array' (line 6) could be declared as pointing to const

Bye,
bearophile
May 06, 2011
Re: Patterns of Human Error - my presentation at the DC ACM
Walter:

> Interestingly, nobody saw all 5 bugs.

You show this as a bug:
typedef long T;

But did you meant to write this?
typedef long long T;

With this change the C lint finds this bug too.

Bye,
bearophile
May 06, 2011
Re: Patterns of Human Error - my presentation at the DC ACM
I still giggle at the "long long" name. Good thing there are no floats
floats and char chars.
May 07, 2011
Re: Patterns of Human Error - my presentation at the DC ACM
On 5/6/2011 3:50 PM, bearophile wrote:
> Walter:
>
>> Interestingly, nobody saw all 5 bugs.
>
> A good C lint has caught three of them,

C lint is not standard C.

That's just the trouble with 3rd party tools. They:

1. are not part of the language
2. have wildly varying effectiveness and quality
3. have no standardized behavior
4. get out of sync with compiler & language changes
5. tend to have installation issues like all 3rd party add-on tools do
6. tend to not be available on the same platforms the language is on
7. are not routinely used

For real progress to be made, the *language* must be improved.
May 07, 2011
Re: Patterns of Human Error - my presentation at the DC ACM
* Nick Sabalausky:

> Is there anything reddit doesn't auto-flag as junk?

Perhaps content that is actually viewable and accessible?
May 11, 2011
Re: Patterns of Human Error - my presentation at the DC ACM
Andrej Mitrovic Wrote:

> I still giggle at the "long long" name. Good thing there are no floats
> floats and char chars.

`long` is not a type, it's a modifier and - accidentally - a shortcut for `long int`.
`long long` is a shortcut for `long long int`.
`short` is a shortcut for `short int`.
`signed` is a shortcut for `signed int`.
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home