Questions tagged [gcc4.7]

Version 4.7 of GCC (GNU Compiler Collection). GCC is the de facto standard C compiler on Linux (though version 4.7 is not used by modern versions of Linux). The compiler collection supports many other languages and platforms as well.

Version 4.7.0 was released on 2012-03-22. Version 4.7.4 was released on 2014-06-12.

See also:

136 questions
1
vote
1 answer

GCC changing signdess whole expression

I have the following code: unsigned int m_font_timer = 0; int Getsum(int p_top_left_x) { int l_sum = (((p_top_left_x + (m_font_timer >> 2)) & 0x7) - 4 ) >> 2; if (l_sum < 0) l_sum = -l_sum; return l_sum; } Unless I explicitly cast…
Walrfi
  • 113
  • 6
1
vote
1 answer

C printf specifier with variadic arguments. At which point is the undefined behavior problematic?

https://godbolt.org/z/qZVO3a This is a minimal reproduction of the warnings I see. Obviously UB can be bad, but I think while many of the below situations are okay, there's some really nasty uses and I need to determine which require corrective…
will.mont
  • 81
  • 5
1
vote
1 answer

More efficient assembly code?

I've recently began studying assembly. Just wondering why this assembly is written the way it is instead of the alternative "My Assembly" I list below. It cuts out one instruction. Any ideas? Is it too rare of a case where this works? Just…
1
vote
2 answers

How to force MATLAB 2016a to use gcc-4.7.x instead of the one I have (gcc-5.4.1)?

There are some posts about this for the older releases of MATLAB, but they don't seem to work for R2016a. I'm trying to install MatConvNet on Ubuntu 16.04. When I run the vl_compilenn command as described here, it gives me a warning as…
Dr. Prasanna Date
  • 745
  • 1
  • 9
  • 29
1
vote
1 answer

Cannot take string input properly in gcc ubuntu linux

What is wrong in this program?? I am trying to figure out since 2 days but no help at all!! String output is only after string input and after selecting choice, default string input is new line character by default i guess. Besides if i type string…
1
vote
1 answer

GCC force warning to be an error: excess elements in array initializer

My projects have to compile with two different compilers. One that creates a DLL (for a PC simulation, Mingw32-gcc-4.7.2) and another one that creates an ELF (for real hardware). Both compilers have partially different behaviors, but we want them to…
Matthias
  • 1,200
  • 2
  • 13
  • 33
1
vote
2 answers

Using two or more optimize option with GCC command

I am trying to compile a opensource component from source code. I am compiling all C files in that component using gcc command. When I pass options in order -O2 -Os, binary is in few KB's. But when I pass options in order -Os -O2 binary size is…
Krishna M
  • 1,135
  • 2
  • 16
  • 32
1
vote
1 answer

How to open and read the content of a file with unicode path or filename by using standard API?

How to open a file which path or file name contains unicode characters and read or write it's content without using any special API ?. How to do it using only std libraries if it's possible or using only windows API ?. I did try std::wifstream to…
user1978386
  • 237
  • 8
  • 19
1
vote
0 answers

Tracking an issue with -fvisibility=hidden that triggers a undefined reference to `typeinfo for myfunc'

I am trying to compile a project that is written in portable C++. It does compile fine with Visual Studio 2010 on Windows 7 and makes uses of symbol visibilty macros. However when I compile this project with gcc-4.7 on linux, I am getting this…
malat
  • 12,152
  • 13
  • 89
  • 158
1
vote
1 answer

Strange segfault when compiling with -O3

The following code compiles and works correctly on g++ 4.7.2-5 on Debian 7. #include #include using namespace std; class mystring { char * buf; static char * dupbuf(const char * buf) { char * result = new…
lutzky
  • 598
  • 5
  • 12
1
vote
1 answer

int8 header file not found during compilation

Trying to compile a simple c program and get error. In file included from /opt/local/lib/gcc47/gcc/x86_64-apple- darwin13/4.7.3/include/stdint.h:3:0, from ecl/config.h:134, from ecl/ecl.h:35, from…
1
vote
0 answers

QT 4.8.5 compile error in CentOS 5.X

I have download the Qt-everywhere-4.8.5.tar.gz from Qt official website. And In the CentOS 5.X, it's GCC version is 4.1.2. So I have compiled the gcc-4.7.2 from source code and installed it in $HOME/software/, then in the install directory, there…
mining
  • 3,557
  • 5
  • 39
  • 66
1
vote
2 answers

Error installing glib

I am trying to install the glib-2.38.0 and upon executing the MAKE file and getting the following error: make[5]: Leaving directory `/root/glib-2.38.0/glib/update-pcre' make[4]: Leaving directory `/root/glib-2.38.0/glib/update-pcre' Making install…
1
vote
1 answer

Does it matter that I update the gcc 4.6 to 4.7 or higher in Ubuntu 12.04(LTS)

I found that more and more open source libraries will use C++11 features, and my Ubuntu Desktop 12.04 just has gcc 4.6, I want to use the update-alternatives to change the default gcc version into 4.7 or 4.8. I wonder that, if the libraries in the…
mining
  • 3,557
  • 5
  • 39
  • 66
1
vote
1 answer

configure error: C compiler cannot create executables

I was trying to install rvm ( \curl -L https://get.rvm.io | bash -s stable --ruby --autolibs=enable --auto-dotfiles). It worked fine until ZI got a configure error: Error running './configure --prefix=/home/nishant/.rvm/rubies/ruby-2.0.0-p247…
nish
  • 6,952
  • 18
  • 74
  • 128