Uz.ytkownik Alexander Viro napisa?:
>
> Newsflash: for Homsky-3 grammar "reg exp guessing" _IS_ complete parser
> in the formal sense.
Unsually only unless you compre it with your *intentions*.
Please don't confuse definition of grammar with parser implementation
despite that fact the reg-exp stuff is looking like declarative
programming. Whot it does is *not* always equivalent to what it should.
OK?
>>>is tough". Examples on demand, including real gems like
>>> fread(&foo, sizeof(foo), 1, fp);
>>> if (foo.x >= 100000 || foo.y >= 100000)
>>> /* fail and exit */
>>> p = (char *)malloc(foo.x * foo.y);
>>> if (!p)
>>> /* fail and exit */
>>> for (i = 0; i < foo.x; i++)
>>> fread(p + i*foo.y. 1, foo.y, fp);
>>>and similar wonders (if anybody wonders what's wrong with the code above,
>>>you need to learn how multiplication is defined on int and compare 10^10 with
>>>2^32). And yes, it's real-life code, from often-used programs. Used on
>>>untrusted data, at that.
>>
>>Storing the constants in question in the above code sample
>>as ASCII at the start of where foo is pointing at, would have hardly
>>saved the poor overworked programmers mind from precisely the same
>>mistake he did above. (Needless to say that you actually forgott
>>to mention that the code fails on <= 32 bit systems. Inestad of
>>providing te "hint" for guessing where the actual error is.)
>
>
> Huh???
>
> you: "it's easy to screw up when working with ASCII strings"
> me: "tossers will find a way to screw up on anything, no matter what it is;
> see example of tosser screwing up on plain arithmetics"
> you: "use of ASCII wouldn't help them in that case"
>
Scratch the above: I tell you: "Not unsing ASCII is greatly
diminishing the propability of the occurrance of the error."
And error rate depends on the size of code. No matter how
perfect you think someone has to be as a coder.
No code - no errors. The same buggy code twice - twice the same errors.
> Sure thing, it wouldn't. _Nothing_ short of acquiring some clue would.
> Possible solutions:
> A) replace all arithmetics with BIGNUMs (and just you wait for
> first out-of-memory)
> B) get rid of tossers.
>
> Matter of taste, indeed, but I'd rather go for (B) - has a benefit of
> solving many other problems.
No. The vomitting only moves to the time where you actually get your ass
up from the kernel and take a look at the code trying to use it. And
then it's more painfull. Go libproc or its relatives please. I don't
blaim Albert for it! I blaim the interface.
I don't try to tell you that binary interfaces are the best thing
since slice bread. They are just less worse for the *actual* user.
That's the point.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:17 EST