Sean Conner wrote:
Still no. It returns (error ? -1 : ptr == NULL ? size : 0);
Isn't that what I said? "returns the number of bytes iff [1] ptr is
NULL; othersise it returns 0 on success and -1 on an error." Where
in there did I go wrong?
I don't know. Either you don't understand my C or you don't understand
your English.
I see my mistake---I forgot a "not" between "ptr" and "
No, I was right the first time.
Aaaaaah!
Okay, I give up!
I can't understand your code. I can't understand English. I can't
understand why you won't take a simple modification. I'm done here.
Look, the return value depends on two variables (ptr, error) as in:
ptr | NULL | mem | NULL | mem |
error | no | no | yes | yes |
-------------+------+------+------+------+------------
return | size | 0 | -1 | -1 |
Your statement in English as I read it however suggests the
following behavior:
ptr | NULL | mem | NULL | mem |
error | no | no | yes | yes |
-------------+------+------+------+------+------------
return | size | 0 | size | -1 |
See the difference? See the consequences (crashes) if libtcc users
follow your specification?
Despite of your problems to describe it, your usage is correct though:
https://github.com/spc476/lua-conmanorg/blob/master/src/tcc.c#L397
Anyway, like anyone working for free I rather push my own brilliant
ideas than anyone else's so now we have the one-function/triple-option
approach and I'm fine with it and you can live with it, at least.
http://repo.or.cz/w/tinycc.git/commitdiff/ca38792df17fc5c8d2bb6757c512101610420f1e
Thanks,
--- grischka
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel