bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] addition: size_max.m4, ptrdiff_max.m4


From: Bruno Haible
Subject: Re: [Bug-gnulib] addition: size_max.m4, ptrdiff_max.m4
Date: Thu, 13 Nov 2003 21:43:23 +0100
User-agent: KMail/1.5

Paul Eggert wrote:
> #define SIZE_MAX 
> (2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(2*(1ul)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)+1)
>
> and expressions like these can be computed easily using binary search.

Reprensenting one bit through 6 characters? I think many developers who
look at the "gcc -E" output will hate us for this. But maybe it this issue
can be solved through some postprocessing that converts the binary number
to hexadecimal. For example, you repeat the following sed on it until it
doesn't change any more:

sed -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+0)+0)+0)+0),(\10\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+0)+0)+0)+1),(\11\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+0)+0)+1)+0),(\12\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+0)+0)+1)+1),(\13\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+0)+1)+0)+0),(\14\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+0)+1)+0)+1),(\15\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+0)+1)+1)+0),(\16\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+0)+1)+1)+1),(\17\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+1)+0)+0)+0),(\18\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+1)+0)+0)+1),(\19\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+1)+0)+1)+0),(\1a\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+1)+0)+1)+1),(\1b\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+1)+1)+0)+0),(\1c\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+1)+1)+0)+1),(\1d\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+1)+1)+1)+0),(\1e\2),' \
    -e 's,(2\*(2\*(2\*(2\*(\([0-9A-Fa-f]*\)\([ULul]*\))+1)+1)+1)+1),(\1f\2),'

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]