mardi 31 août 2021

g++ compiler gives me errors with -std=c++11 flag, but it compiles fine with -std=gnu++11. what does this mean?

I'm maintaining an old server at work, which is running on CentOS6(gcc (GCC) 4.4.7, C++98) and I was trying to migrate it to CentOS7(gcc (GCC) 4.8.5) with C++11.

At first, I tried to compile with a flag, -std=c++11 but it gaved me a lot of error like below.

`In file included from /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/x86intrin.h:30:0,
                 from /usr/include/c++/4.8.2/x86_64-redhat-linux/bits/opt_random.h:33,
                 ...
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/mmintrin.h: In function ‘__m64_mm_cvtsi32_si64(int)’:
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/mmintrin.h:61:54: error: can’t convert between vector values of different size
   return (__m64) __builtin_ia32_vec_init_v2si (__i, 0);
                                                      ^
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/mmintrin.h: In function ‘int _mm_cvtsi64_si32(__m64)’:
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/mmintrin.h:104:53: error: cannot convert ‘__m64 {aka int}’ to ‘__vector(2) int’ for argument ‘1’ to ‘int __builtin_ia32_vec_ext_v2si(__vector(2) int, int)’
   return __builtin_ia32_vec_ext_v2si ((__v2si)__i, 0);`

Somehow, I encountered about using a flag, -std=gnu++11 and it worked fine.

What can I assume with this? Does this mean that the old server code is somehow using gnu extension or whatever?

Aucun commentaire:

Enregistrer un commentaire