Questions tagged [gcc5.2]

For questions related to the GNU gcc compiler or suite, 5.2.x versions.

14 questions
8
votes
1 answer

C++11 regex::icase inconsistent behavior

Coming from perl-like regular expressions, I expected the below code to match regex'es in all 8 cases. But it doesn't. What am I missing? #include #include #include using namespace std; void check(const string& s, regex…
glexey
  • 811
  • 7
  • 25
6
votes
3 answers

No warning when returning NULL with gcc

Using gcc 5.2.0, I noticed that this code does not generate a warning: #include int function(void) { return NULL; } void procedure(void) { return NULL; } I used the flags -Wall -Wextra -std=c99 -pedantic and I am running…
damwdan
  • 71
  • 5
4
votes
1 answer

std::string & as template parameter and abi_tag in gcc 5

Consider the following piece of code (test1.cpp): #include extern std::string test_string; template class test{ public: static void bar(){ } }; std::string test_string("test string"); void…
4
votes
8 answers

How to use C11 standard in Code::Blocks

Like the Title says I need to make code::blocks to work with C11 and I can't figure out how to do it. I went to settings => compiler settings => Other options and I added -std=c11 and tried also with -std=gnu11, both doesn't seems to work. I…
Michi
  • 5,175
  • 7
  • 33
  • 58
3
votes
1 answer

template being deduced as wrong type with template variable

So I have the following test code: struct empty_value{ template T as(){ return T(0); } }; template auto empty_func(empty_value lhs, empty_value rhs, F f) -> decltype(f(lhs.as(),…
RamblingMad
  • 5,332
  • 2
  • 24
  • 48
2
votes
1 answer

C++ lambda callbacks

I am trying to make an HTTP class, and I want to use C++11 (not C++14 yet) callbacks via lambdas. I have 2 mockups available, the first one works... but looks ugly. The second one I am aiming, is not compiling (error at the end). I cannot use…
elcuco
  • 8,948
  • 9
  • 47
  • 69
1
vote
0 answers

idirafter flag inserts a new character while macro expansion in gcc 5.2.0

During the compilation of a C file I used idirafter flag to mention the directory to look if it does not find the file in any of the locations mentioned using -I. To simulate the problem I have written a small sample program which is as below. I am…
1
vote
1 answer

Linker error while building with MSVC 2015 (other CC are OK)

Here is the MCVE: #include #include using namespace std; class Obj { public: Obj() { cout << "Obj()" << endl; } ~Obj() { cout << "~Obj()" << endl; } void* operator new(size_t sz){ return ::operator new(sz); …
Dmitry Sokolov
  • 3,118
  • 1
  • 30
  • 35
1
vote
0 answers

linux kernel undefined reference to '__compat_exports_start'

The same situation like in the last question. An android kernel (3.4.0), that I try to compile with gcc 5.2 (Linaro toolchain). arch/arm/mach-msm/built-in.o:memory.c:function check_for_compat: error: undefined reference to…
0
votes
1 answer

ASAN with gcc-5.2 not intercepting exceptions

I was using the ASAN with gcc-4.8.2 for last 2 years without any issue. We moved to gcc-5.2 to use the new features like LSAN. After building the application with gcc-5.2 its not able to intercept the __cxa_throw anymore leading to a crash, found…
0
votes
1 answer

proper linking of PATH and LD_LIBRARY_PATH after gcc-5.2 install in own directory

I just compiled and installed gcc-5.2. I did not have root access so I installed it in my own directory. I forget at the end what I am meant to link through LD_LIBRARY_PATH and PATH setenv LD_LIBRARY_PATH…
Griff
  • 2,064
  • 5
  • 31
  • 47
0
votes
2 answers

Implicit declaration of function ‘fgetc_unlocked’, using gcc 5.2

I have the following code: #include int main() { putc_unlocked('a', stdout); return 0; } I get no error when I compile it using gcc file.c, however, if I use gcc -std=c11 file.c, I get: file.c: In function ‘main’: file.c:4:2:…
dario2994
  • 48
  • 6
0
votes
1 answer

How can I get the exact value of a double?

I have a situation where: void foo( const double d ) { const double rounded_2_decimals = std::round(d*100.0) / 100.0; std::cout << "d=" << d << std::endl; std::cout << "r=" << rounded_2_decimals << std::endl; } When printed, d=3.125,…
Stéphane
  • 19,459
  • 24
  • 95
  • 136
0
votes
0 answers

Error passing argument 2 of 'crypto_compress_setup' discards 'const' qualifier from pointer target type

I try to compile an android kernel with gcc 5.2 and i fixed all errors, except this: crypto/testmgr.c:1112:36: warning: passing argument 2 of 'crypto_compress_setup' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] error,…