bug-gplusplus
[Top][All Lists]
Advanced

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

initialization of float arrays


From: Gabriel Zachmann
Subject: initialization of float arrays
Date: 6 Sep 2001 13:56:16 GMT
User-agent: slrn/0.9.7.0 (Linux)

When I have an array like this:

    float qs[][4] = { {-0.441726, -0.441726, 0.552158, -0.552158} ,
                      {res/2, res/2, res/2, res/2 },
                      {res/2-1, res/2-1, res/2-1, res/2 },
                      {res/2, -res/2+0.1, -res/2+0.1, -res/2+0.1 },
                    };

I see in gdb this:

(gdb) p qs
$12 = {{-0.441725999, -0.441725999, 0.552157998, -0.552157998}, {1, 1, 1,
1}, {
    0, 0, 0, 1}, {1, 2.14748365e+09, 2.14748365e+09, 2.14748365e+09}}
(gdb) p res
$13 = 2

which is, of course, bogus.

This seems like a bug to me.
I think it is a bug of g++.

This happens under RedHat 7.1 with g++ 2.96 and gdb 5.0rh-15.

Gab.


-- 
/---------------------------------------------------------------------\
| And what if all of animated nature                                  |
| Be but organic Harps diversely fram'd,                              |
| That tremble into thought, as o'er them sweeps                      |
| Plastic and vast, one intellectual breeze,                          |
| At once the Soul of each, and God of all?  (Samuel Taylor Coleridge)|
|                                                                     |
| address@hidden                 __@/'  address@hidden |
| web.informatik.uni-bonn.de/~zach    __@/'   www.gabrielzachmann.org |
\---------------------------------------------------------------------/



reply via email to

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