Search This Blog

Saturday, October 13, 2007

list of predefined macros

Situation:

guile-1.8_1.8.2+1 failed to build on alpha architecture. The complete build log can be found at http://buildd.debian.org/fetch.cgi?&pkg=guile-1.8&ver=1.8.2%2B1-1&arch=alpha&stamp=1188086025&file=log

The buildlog tells us that the problem is in line 96 of test-round.c . To debug the problem further, the source of guile-1.8 can be downloaded by using

$cd practice/guile/
$apt-get source --download-only guile-1.8
$dpkg-source -x guile-1.8_1.8.2+1-2.dsc
$cd guile-1.8-1.8.2+1/

To see where test-round.c is residing

$find . -iname '*test-round.c*'
./test-suite/standalone/test-round.c

Now when we look at the source code of test-round.c around line 96

$cd test-suite/standalone/
$vim +96 test-round.c

we find that there is a predefined macro called DBL_MANT_DIG . But what is its value? More generally, how can we get a list of all the predefined macros and their values?

Solution:
The answer is surprisingly simple. Just do

$g++ -E -dM - < /dev/null

#define __DBL_MIN_EXP__ (-1021)
#define __FLT_MIN__ 1.17549435e-38F
#define __DEC64_DEN__ 0.000000000000001E-383DD
#define __CHAR_BIT__ 8
#define __WCHAR_MAX__ 2147483647
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __FLT_EVAL_METHOD__ 2
#define __DBL_MIN_10_EXP__ (-307)
#define __FINITE_MATH_ONLY__ 0
#define __GNUC_PATCHLEVEL__ 3
#define __DEC64_MAX_EXP__ 384
#define __SHRT_MAX__ 32767
#define __LDBL_MAX__ 1.18973149535723176502e+4932L
#define __UINTMAX_TYPE__ long long unsigned int
#define __linux 1
#define __DEC32_EPSILON__ 1E-6DF
#define __unix 1
#define __LDBL_MAX_EXP__ 16384
#define __linux__ 1
...

Since our interest is in the predefined macro DBL_MANT_DIG, the above output can be filtered by using grep.

$g++ -E -dM - < /dev/null | grep -i __DBL

#define __DBL_MIN_EXP__ (-1021)
#define __DBL_DENORM_MIN__ 4.9406564584124654e-324
#define __DBL_MIN_10_EXP__ (-307)
#define __DBL_DIG__ 15
#define __DBL_MAX__ 1.7976931348623157e+308
#define __DBL_HAS_INFINITY__ 1
#define __DBL_MAX_EXP__ 1024
#define __DBL_MIN__ 2.2250738585072014e-308
#define __DBL_HAS_QUIET_NAN__ 1
#define __DBL_HAS_DENORM__ 1
#define __DBL_MANT_DIG__ 53
#define __DBL_EPSILON__ 2.2204460492503131e-16
#define __DBL_MAX_10_EXP__ 308

This clearly tells us that DBL_MANT_DIG is 53 on this particular machine. More information about macros like DBL_MANT_DIG can be found in files
  • /usr/share/doc/glibc-doc-reference/html/Floating-Point-Parameters.html
  • /usr/share/doc/glibc-doc-reference/html/IEEE-Floating-Point.html
  • /usr/share/doc/glibc-doc-reference/html/Library-Summary.html
etc., which are all part of glibc-doc-reference package. On a Debian machine, this package can be installed by doing

$apt-get install glibc-doc-reference

Monday, October 01, 2007

websites incompatible with iceweasel

As we all know, iceweasel is basically a renamed version of firefox in Debian. The renaming was due to licensing issues. Except for the renaming there is no difference between firefox and iceweasel.

The following are the list of websites that wont work properly with iceweasel. The tests are performed with iceweasel 2.0.0.16, Debian Etch (Stable).


It is not very difficult to design a website which works the same way on all the browsers. I wonder why these companies are so incompetent in putting up a W3C standard complaint web site and not use any proprietary software. It also makes one wonder, if it would be better to take the business to companies who have the decency/ability to set up a browser-friendly website?

Updated on : Sep 25, 2008; Oct 1, 2007

Update on: July 27, 2014
On a machine runing Debian Jessie, iceweasel  30.0

Followers