Jiba wrote:

Ok, I've added this compile flag (I prefer this solution to Greg's one,
> because one may write new code and ignore that all char would need to be
> explicitely marked as signed or unsigned).

Certainly it's an easier way of fixing it in the short term,
but I still think it would be better to aim at eliminating
all such usages from the code in the long term.

Code which relies on particular compiler options to work
correctly (as opposed to just more efficiently) is fragile.
If anyone ever forgets and compiles it without the required
option, a very subtle bug comes back from the dead to bite
them.

Also it makes the code non-portable in another way, by
tying it to the capabilities of a particular compiler.
One day someone might want to compile it with a compiler
that doesn't have an option for signed chars, and then
they're faced with having to track down all the places
that depend on signed chars and fixing them properly.

Writing code that doesn't depend on the signedness of
chars may require some discipline, but in my opinion it's
better to learn that discipline than to go on writing
non-portable code and patching over the problems.

--
Greg

_______________________________________________
Soya-user mailing list
[email protected]
https://mail.gna.org/listinfo/soya-user

Reply via email to