Message buffer and printf reentrancy patch

Daniel C. Sobral dcs at tcoip.com.br
Tue Jun 24 04:51:45 PDT 2003


Erik Trulsson wrote:
> 
> With a C99 compiler it is always true.  In C89 it was implementation
> defined if integer division rounded towards zero or towards
> negative-infinity.  In C99 integer division always rounds towards zero.
> This combined with the fact that (a/b)*b + a%b == a is always true (for
> integer a,b and b!=0) means that (neg_int % pos_int <= 0 ) is always
> true in C99, while it wasn't always true in C89.

Heh. I recall when ANS Forth was being discussed that people found it 
silly all the discussion around whether signed integer division was 
symmetric or floored, when even C didn't bother with it. :-)

(And, if you are interested in such things, the problem was that 
Forth-79 was symmetric, Forth-83 was floored (or vice versa -- I don't 
know); the solution was to leave / as implementation defined and 
creating two new operators: one symmetric and one floored. :)

-- 
Daniel C. Sobral                   (8-DCS)
Gerencia de Operacoes
Divisao de Comunicacao de Dados
Coordenacao de Seguranca
VIVO Centro Oeste Norte
Fones: 55-61-313-7654/Cel: 55-61-9618-0904
E-mail: Daniel.Capo at tco.net.br
         Daniel.Sobral at tcoip.com.br
         dcs at tcoip.com.br

Outros:
	dcs at newsguy.com
	dcs at freebsd.org
	capo at notorious.bsdconspiracy.net

I finally got it all together ...
but I forgot where I put it.



More information about the freebsd-arch mailing list