0
votes
4answers
56 views

How is this c function decrementing my counter?

I have the following code: int i; for(i=0;i<2;i++) { ... printf("i = %d\n",i); rtdb_pull(rtdb, buf, &ncenter); printf("i = %d\n",i); ... } When I run it, it goes through just fine ...
0
votes
1answer
48 views

Shakespearean Programming Language

To translate hello.spl to C, I run ./spl2c <hello.spl> hello.c which works fine. Next I run gcc hello.c, but I get "fatal error: spl.h: No such file or directory". spl.h and hello.c are in the ...
0
votes
0answers
36 views

Why does GCC take so much longer to build than llvm/clang?

This is a question about the process of building the compilers themselves. On my machine, compiling gcc (for C, C++, and objc) takes hours, while llvm + clang + clang++ is probably 10-20 minutes, ...
1
vote
2answers
65 views

How to enable the highest warning level in GCC compiler(Boost is heavily used)

I just read a book which recommends enable the highest warning level in GCC. I just check the doc online, and found there are too much parameters. I want to enable the highest warning level, which ...
1
vote
0answers
10 views

Data dependencies using gcc dump

I have some C/C++ code. I want to get information about the data dependencies within a function e.g. If there is a variable declared in line 1 and used in line 2 then i want to know this dependency. ...
2
votes
1answer
31 views

Compiling with both -g3 and -O3

Most build environments I've seen have at least two strategies: debug build vs final/optimized/release build. With gcc, this usually means some version of -g vs -O. Now I'm seeing a situation where ...
2
votes
1answer
102 views

How to ensure my code is ansi C, no C++ involved. Could compiler like gcc can be set to prompt error when meeting feature in C++?

I programmed C++ for a while. Now I want to program a ANSI C program, don't want any "C++ only" feature in the code. I'm using cygwin 64 bit with gcc installed. Are there any settings to let gcc ...
-1
votes
1answer
33 views

Run exe file through Cygwin .error output :Segmentation fault(core dumped)

I am new with cygwin and C programm. I got a tough problem #include <stdio.h> #define N 10 int main() { int nPerson[N]={9,11,23,44,2,4,5,6,7,3}; int nFloor,nMinFloor,nTargetFloor; ...
2
votes
3answers
64 views

storage of bool in c under various compilers and optimization levels

trivial example program: #include <stdio.h> main() { bool tim = true; bool rob = false; bool mike = true; printf("%d, %d, %d\n", tim, rob, mike); } Using the gcc compiler it ...
0
votes
2answers
29 views

Pack two binaries(executables) into one file

I have two binary(executable) files A and B. At runtime, A may call B depending on given parameters. Is it possible to pack the two binaries into one file? So that, when needed, A do not have to look ...
-3
votes
5answers
95 views

C++ default initialization of built-in types [closed]

Do all "real" C++ compilers don't have default initialization with zeros of built-in types? I'm asking 'cos I've found on-line compilers that is claimed to be gcc, and it does zero initialization of ...
-1
votes
2answers
29 views

Wrong common expression substitution in C compiler?

double *p; Apparently, gcc 4.6.3 only increments p by 1 in the following line under -O3. myfunc (*(p++), *(p++)); Is this a bug?
0
votes
1answer
39 views

How do I make the c++ compiler search for libraries in /usr/local/lib?

I am using clang on a Mac but I think this question will have the same answer for gcc (and any other unix system -- hopefully). Right now, I can't link against libboost because it lives in ...
1
vote
1answer
29 views

netcat gcc compile option so that IDA pro can show function name

I want IDApro show functions name and variables, like: _readwrite, _dolisten but it only shows sub_40xxxx in function window. How can I edit the compile option to achieve it? The original Makefile ...
0
votes
1answer
37 views

Makefile C++11 - Compiling to static library

I am trying to compile my source files to a static library, however, it doesn't seem to want to work. Here is the code: #----------------------------------------------------------------------------- ...

1 2 3 4 5 36
15 30 50 per page