C++ c++;Qt和QLinkedList的严格别名规则编译错误

C++ c++;Qt和QLinkedList的严格别名规则编译错误,c++,qt,templates,compiler-errors,g++,C++,Qt,Templates,Compiler Errors,G++,这段代码与gcc(ubuntu4.4.3-4ubuntu5.1)4.4.3以及g++(Ubuntu/Linaro 4.7.2-2ubuntu1)4.7.2进行了很好的编译,并在g++(Debian 4.4.5-8)4.4.5中失败。。。我不知道为什么?有人看到过此错误消息,有人知道这可能意味着什么吗?。。。更重要的是如何解决它?别名意味着指针int*i指向与double*d相同的地址。 所以如果 这里的d是别名pi 这是在c99>中,这篇文章确实很好地描述了它:是的,我在发布这个问题之前看到了这

这段代码与
gcc(ubuntu4.4.3-4ubuntu5.1)4.4.3
以及
g++(Ubuntu/Linaro 4.7.2-2ubuntu1)4.7.2
进行了很好的编译,并在
g++(Debian 4.4.5-8)4.4.5
中失败。。。我不知道为什么?有人看到过此错误消息,有人知道这可能意味着什么吗?。。。更重要的是如何解决它?

别名意味着指针
int*i
指向与
double*d
相同的地址。 所以如果

这里的
d
是别名
pi


这是在c99>中,这篇文章确实很好地描述了它:是的,我在发布这个问题之前看到了这篇文章,Qt标题实际上使用了这种技术。。。所以,这肯定是不同的。如果你做了一个比较好的选择,你可能会得到更好的帮助,这样其他人就可以编译它并戳它了。什么Qt版本?
In file included from /usr/local/Qt/linux-g++/include/QtCore/QLinkedList:2,
  from /home/bamboo/Packages/Parser.h:17,
  from /home/bamboo/Packages/Module.cpp:6:
/usr/local/Qt/linux-g++/include/QtCore/qlinkedlist.h: In member function 'void QLinkedList<T>::clear() [with T = int]':
/usr/local/Qt/linux-g++/include/QtCore/qlinkedlist.h:294: error: dereferencing pointer 'y' does break strict-aliasing rules
/usr/local/Qt/linux-g++/include/QtCore/qlinkedlist.h:293: note: initialized from here
/usr/local/Qt/linux-g++/include/QtCore/qlinkedlist.h:294: error: dereferencing pointer 'y' does break strict-aliasing rules
/usr/local/Qt/linux-g++/include/QtCore/qlinkedlist.h:293: note: initialized from here
template <typename T> class Parser
{
   // some stuff
   QLinkedList<T> stuff;
};
int i = 5;
int *pi = &i:
double *d = pi;
uint32_t anint;

int main(int arg, char** argv)
{
    foo ((uint64_t *)&anint);
    return 0;
}

void foo (uint64_t *dblptr)
{
    anint = 88;
    *dblptr = 86;
    dosmthng (anint);
}

void dosmthng (uint32_t val)
{
    printf ("%d\r\n", val);
}