gcc

How to force gcc use int for system calls, not sysenter?

Hi, all Is it possible to force gcc use int instruction for all the system calls, but not sysenter? This question may sound strange but I have to compile some projects like Python and Firefox this way. Summary Thanks to jbcreix, I've downloaded glibc 2.9 source code, and modified the lines in sysdeps/unix/sysv/linux/i386/sysdep.h, to ...

how to suggest gcc compiler more probable branch

Example: if (almost_always_false_condition) { // do something } Is there a way to suggest compiler that in 99% condition will be false. The condition calculation takes ~60 cycles to be checked, and it cannot be calculated at compile time by compiler itself. (gcc 4.3) ...

gcc reverse_iterator comparison operators missing?

I am having a problem using const reverse iterators on non-const containers with gcc. Well, only certain versions of gcc. #include <vector> #include <iostream> using namespace std; int main() { const char v0[4] = "abc"; vector<char> v(v0, v0 + 3); // This block works fine vector<char>::const_iterator i; for (i = ...

How to compile this on Windows

Ok. I am trying to compile the following application on Windows (Segmenter, see step 3). I checked out the source and changed the references so that'd all be good. It's basically a one file app, with a reference to ffmpeg. The makefile reads: gcc -Wall -g segmenter.c -o segmenter -lavformat -lavcodec -lavutil -lbz2 -lm -lz -lfaac...

g++ alignment problem

I have the following code: #include <stdio.h> int main(void) { int x __attribute__ ((aligned (16))) = 0; printf("%lX\n", &x); return 0; } Compiling and running this code using mingw32-c++.exe (GCC) 3.4.5 (mingw-vista special r3) prints 0x22FF24 which is 0b1000101111111100100100. Compiling and running this code using g++ ...

Unknown error in array initilization

I was trying to make a Intel 8080 CPU emulator (then I'd like to emulate Space Invaders, which use it). I coded nearly complete implementation of this CPU (thanks to MAME and Tickle project (mostly) ;) ) except undocument instructions (0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38, 0x0CB, 0x0D9, 0x0DD, 0x0ED, 0x0FD). I've have only problems...

Layout of compiled objects

Is there a waymuch like viewing the result of preprocessing with gcc -Eto see what my objects look like once compiled into object files? I am talking about GCC, but a solution including MSVC would be fine. ...

gcc Can't Find a Included Header

I'm using a header called colors.h to organize my source code. The header is like this: #define DEFAULT 0x07 #define BLACK 0 #define GRAY 7 #define BLUE 9 #define GREEN 10 #define CYAN 11 #define RED 12 #define MAGENTA 13 #define YELLOW 14 I'm putting the header at the same directory of the main source code, called kernel.c, and inclu...

Does gcc, icc, or Microsoft's C/C++ compiler support or know anything about NUMA?

If I have a multi-processor board that has cache-coherent non-uniform memory access ( NUMA ), i.e. separate "northbridges" with separate RAM for each processor, does any compiler know how to automatically spread the data across the different memory systems such that processes working on local threads are mostly retrieving their data from...

GCC Produced Dlls Not Compatible with Intel Visual Fortran?

I used gcc to compile a few fortran source files into *.lib and *.dll on Windows platform, using the latest version of mingw . The gcc used is version 3. The result of the output is arpack_win32.dll, blas_win32.dll and lapack_win32.dll. I then want to compile sssimp.f against the arpack_win32.dll, blas_win32.dll and lapack_win32.dll usi...

Problem with building applications for 10.4

When I try to build my app for 10.4, ppc, I get the following error: GCC 4.2 is not compatible with the Mac OS X 10.4 SDK (file MBM.m) What does this mean, and how can I stop it and build for 10.4? MBM.m: http://localhostr.com/files/bb385f/MBM.m Sorry for the brief explanation, but I have to go. Please help, HiGuy S ...

gcc and g++ not provided by the webhosing machine

All, In a webserver if gcc and g++ are not provided by the hosting service to the user.Can we download it and compile through it in RHEL5 OS. If so please provide the suitable link to download it. Thanks...... ...

How to get return value from CHILD PROCESS?

Program calculates sum of numbers from 1 to N.. Child process calculates sum of EVEN numbers. Parent process calculates sum of odd numbers. I want to get the return value of child process in parent process. How do i do that #include<stdio.h> #include<errno.h> #include<unistd.h> #include<stdlib.h> #include<fcntl.h> int main() { int ...

How to avoid gcc warning in Python C extension when using Py_BEGIN_ALLOW_THREADS

The simplest way to manipulate the GIL in Python C extensions is to use the macros provided: my_awesome_C_function() { blah; Py_BEGIN_ALLOW_THREADS // do stuff that doesn't need the GIL if (should_i_call_back) { Py_BLOCK_THREADS // do stuff that needs the GIL Py_UNBLOCK_THREADS } Py_E...

Windows: preventing assert() failures from opening the debug popup

How can I prevent the debug popup window from appearing when an assertion fails on a Windows machine? The app I'm writing is console based and I'm using assert() to test certain things when it's executed in test mode. I'm using MinGW + GCC 4. Edit: This is the test program. #include <stdlib.h> #include <assert.h> int main(void) { ...

__builtin_apply 's size argument for constructing call in gcc ?

Hi, i would like to play with the constructing calls feature of gcc... From the doc : — Built-in Function: void * __builtin_apply (void (*function)(), void *arguments, size_t size) This built-in function invokes function with a copy of the parameters described by arguments and size. The value of arguments should be...

Cygwin compiling error: "this application has requested the runtime to terminate it in an unusual way"

I am trying to run Cygwin, and I am running into some problems. I tried to compile a program that works both on Windows with mingw and on a Unix system, but when I go to compile it through Cygwin: gcc threads.c -o threads I get the error: this application has requested the runtime to terminate it in an unusual way And that's it... a...

gcc: warning: large integer implicitly truncated to unsigned type

#include<stdio.h> int main() { unsigned char c; c = 300; printf("%d",c); return 0; } Is the output in any way predictable or its undefined?? ...

Objective c doesnt like my unichars?

Xcode complaints about "multi-character character contant"'s when I try to do the following: static unichar accent characters[] = { 'ā', 'á', 'ă', 'à' }; How do you make an array of characters, when not all of them are ascii? The following works just fine static unichar accent[] = { 'a', 'b', 'c' }; Workaround The closest work ar...

Get a pointer to the current function in C (gcc) ?

Hi, is there a magic variable in gcc holding a pointer to the current function ? I would like to have a kind of table containing for each function pointer a set of information. I know there's a _func_ variable containing the name of the current function as a string but not as a function pointer. This is not to call the function th...