gcc4.8

Is there a GCC warning that detects bit shift operations on signed types?

只谈情不闲聊 提交于 2019-12-01 02:48:50
If I read the C++ ISO specification (sections 5.8.2 and 5.8.3) right, the right-shift of negative signed types is implementation specific and the left-shift undefined behaviour. Therefore I would like to find shift operations on signed types in our legacy source code which we compile with g++ 4.8.2. Unfortunately, I couldn't find such an option in the manual . I can for example compile this code with "g++ -Wall -Wextra -pedantic" without a warning: int si = -1; int left = si << 1; // -2 (multiplication by 2, sign is preserved) int right = si >> 1; // -1 (no change, only 1s) Can anyone tell me

Is there a GCC warning that detects bit shift operations on signed types?

走远了吗. 提交于 2019-11-30 22:32:19
问题 If I read the C++ ISO specification (sections 5.8.2 and 5.8.3) right, the right-shift of negative signed types is implementation specific and the left-shift undefined behaviour. Therefore I would like to find shift operations on signed types in our legacy source code which we compile with g++ 4.8.2. Unfortunately, I couldn't find such an option in the manual. I can for example compile this code with "g++ -Wall -Wextra -pedantic" without a warning: int si = -1; int left = si << 1; // -2

GCC doesn't produce line number information even with -g option

◇◆丶佛笑我妖孽 提交于 2019-11-30 15:12:51
问题 I have built and installed GCC 4.8.1 from source: $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.8.1/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ./configure --disable-multilib Thread model: posix gcc version 4.8.1 (GCC) And I've written a simple useless program: $ cat hw.c #include <stdio.h> void foo() { int a; scanf("%d", &a); /* So I can press ctrl+c here. */ printf("Hello world!\n"); } int main() { foo(

__int128 error when compiling 32 bit

廉价感情. 提交于 2019-11-30 04:15:19
问题 c:\...random.h|106|error: expected unqualified-id before '__int128' When I'm compiling a 32 bit program, the above is the error I get. I'm using http://sourceforge.net/projects/mingwbuilds/ Why? My code compiled fine with 4.7.2 but I wanted to update to 4.8 for the bug fixes and it gets rid of the 0 used as null value for pointer warnings when there are no zeros. Many of the bug fixes I want. It compiles my x64 ones just fine on Windows. Is there a way to get it to compile x32 applications?

g++ Linker errors after upgrading to gcc-4.8 on Debian, libc6

此生再无相见时 提交于 2019-11-29 15:12:16
I have just dist-upgraded a Debian Weezy machine to run gcc-4.8 from gcc-4.7. Previously the build environment was sane and was compiling normally. Now it gives the following linker errors, with any program (even a trivial hello world): /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2 /usr/bin/ld: /usr

Strange results when using C++11 regexp with gcc 4.8.2 (but works with Boost regexp) [duplicate]

拟墨画扇 提交于 2019-11-28 00:01:21
This question already has an answer here: Is gcc 4.8 or earlier buggy about regular expressions? 3 answers I tried to use C++11's regular expression but failed even in trivial examples. From the outside, it seems to only compare the strings, for example: std::regex_match(std::string{""}, std::regex{"a?"}) // false (???) std::regex_match(std::string{"a?"}, std::regex{"a?"}) // true (???) In contrast, the Boost's regexp library behaves as I would have expected: boost::regex_match(std::string{""}, boost::regex{"a?"}) // true (OK) boost::regex_match(std::string{"a?"}, boost::regex{"a?"}) // false

When will Gnu C++ support C++11 without explicitly asking for it?

时光毁灭记忆、已成空白 提交于 2019-11-26 09:46:49
问题 Currently, with g++-4.8.1 you have to compile a file in C++11-mode via g++ -std=c++11 -o prog.x prog.cpp Is there a plan when I just can say g++ -o prog.x prog.cpp to compile prog.cpp ? Maybe prog.cpp has #include <regex> thread_local class Widget { int member = 5; } MyType operator\"\" myt(const char*, sze_t); and so on. 回答1: GCC 6.0: https://gcc.gnu.org/gcc-6/changes.html The default mode for C++ is now -std=gnu++14 instead of -std=gnu++98 . 回答2: The closest I think to an answer I can get