help-gplusplus
[Top][All Lists]
Advanced

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

gcc 3.4.2 + fpack-struct + hash_map


From: Thierry
Subject: gcc 3.4.2 + fpack-struct + hash_map
Date: 22 Mar 2005 00:16:04 -0800

Hi,

I have to build a program with g++ and fpack-struct option turned on.

1) version gcc 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)

2) testh.cpp

#include <ext/hash_map>
using namespace __gnu_cxx;

int main (int argc, char* argv[])
{
        hash_map<int, int> inttale;
        return 0;
}

3)The command line to build :
# g++ testh.cpp -fpack-struct

In file included from
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/ios:49,
                 from
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/ostream:45,
                 from
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/iterator:71,
                 from
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/ext/hashtable.h:69,
                 from
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/ext/hash_map:65,
                 from testh.cpp:1:
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/bits/ios_base.h:
In member function `std::_Ios_Fmtflags
std::ios_base::setf(std::_Ios_Fmtflags)':
/usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/bits/ios_base.h:536:
error: cannot bind packed field
`((std::ios_base*)this)->std::ios_base::_M_flags' to
`std::_Ios_Fmtflags&'

(... to make it short :-) ) 

4)
I could not identify any change related to my problem in more recent
version of gcc 3.4.3 (eventhough I plan to try it once I have
succeeded in installing it :( )

 I know that I can apply a specific attribute to the structures that
have to be packed. May be a #pragma pack could also do the trick.

BUT: the program I have to build is made of hundred of source files
and has always been built with the pack-struct option. Thus it's a
very hard task to modify the sources and I would realy prefer a nicer
way to do it :-).

So, I am just looking for a good advice...

Thanks for your help !!


reply via email to

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