gcc4.7

Whats the difference between thread_posixs and thread_win32 in gcc port of windows?

删除回忆录丶 提交于 2019-11-28 21:35:32
I wanted to download the latest available version of gcc 4.7.2 compiler for windows. When i got to this page where i was supposed to see a download link , i confronted with two categories: threads-posix threads-win32 Whats the difference between these two? Are they thread implementations only?I mean are they only different in how they are implemented and thus the ending result (classes, how to use them,etc ) remains the same? Or do they impose a specific coding style? So, the link you provided leads to builds of the standalone gcc 4.7.2 for windows, a.k.a mingw64. In order to build this

gcc nullptr issue

青春壹個敷衍的年華 提交于 2019-11-28 07:55:48
问题 I am porting existing code to compile under gcc 4.7.2 and have run into a strange issue with nullptr. I have managed to boil it down to a simple test case: #include <stdio.h> const char* g_marker = "Original value"; void SetMarker( const char* s ) { g_marker = s; } char* Test1() { return SetMarker( "I was here 1" ), nullptr; } char* Test2() { SetMarker( "I was here 2" ); return nullptr; } char* Test3() { return SetMarker( "I was here 3"), (char*)NULL; } int main() { char* returnValue = Test1(

How to disable narrowing conversion warnings?

冷暖自知 提交于 2019-11-28 07:09:26
问题 I use -Wall and updating to new gcc I have got a lot of warning: narrowing conversion . I want to disable them, but leave all other warnings untouched (ideally). I can find nothing about narrowing in http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html How to disable narrowing conversion warnings? Is it possible at all? P.S. I need to Disable warnings, not fix them in the source code. Blind -Wno-conversion doesn't help. 回答1: As gx_ said, adding -Wno-narrowing to your command line should

Whats the difference between thread_posixs and thread_win32 in gcc port of windows?

时光怂恿深爱的人放手 提交于 2019-11-27 21:03:31
问题 I wanted to download the latest available version of gcc 4.7.2 compiler for windows. When i got to this page where i was supposed to see a download link , i confronted with two categories: threads-posix threads-win32 Whats the difference between these two? Are they thread implementations only?I mean are they only different in how they are implemented and thus the ending result (classes, how to use them,etc ) remains the same? Or do they impose a specific coding style? 回答1: So, the link you

Why is scanf(“%hhu”, char*) overwriting other variables when they are local?

自作多情 提交于 2019-11-27 15:20:00
The title says it all. I'm using GCC 4.7.1 (bundled with CodeBlocks) and I faced a strange issue. Consider this: int main() { unsigned char a = 0, b = 0, c = 0; scanf("%hhu", &a); printf("a = %hhu, b = %hhu, c = %hhu\n", a, b, c); scanf("%hhu", &b); printf("a = %hhu, b = %hhu, c = %hhu\n", a, b, c); scanf("%hhu", &c); printf("a = %hhu, b = %hhu, c = %hhu\n", a, b, c); return 0; } For inputs 1, 2 and 3, this outputs a = 1, b = 0, c = 0 a = 0, b = 2, c = 0 a = 0, b = 0, c = 3 If I, however, declare a, b and c as global variables, it works as expected. Why is this happenning? Thank you in advance