compiler

C89 vs c99 GCC compiler

Is there a difference if I compile the following program using c89 vs c99? I get the same output. Is there really a difference between the two? #include <stdio.h> int main () { // Print string to screen. printf ("Hello World\n"); } gcc -o helloworld -std=c99 helloworld.c vs gcc -o helloworld -std=c89 hellowor...

Cant compile Boost C++ Network Library 0.5

Boost Network I am trying out this code in a small console app on windows (VS2008) but cant compile it. Have linked to the boost.system library. Am i missing a header, #define or another library? Headers #include <boost/network/protocol/http/client.hpp> #include <iostream> Errors using native typeof 1>c:\dev\3rdparty\boostproposed...

GCC compiler infrastructure for VLIW architectures

Do you know how strong VLIW architectures support exists in GCC compiler infrastructure? I know that there are some VLIW architectures supported by GCC. Looking at them, it seems that the pipeline optimizations are left to another optimization layer. Are there good (not GCC internals doc) materials on this? ...

[compiler] Question about first and follow

Given following grammar S -> L=L s -> L L -> *L L -> id What is the first and follow for the non-terminals? If the grammar is changed into S -> L=R S -> R L -> *R L -> id R -> L What will be the first and follow ? Thanks ...

pusha assembly language instruction

I am having a core dump which stack is corrupted. I try to disassemble it and found the following plz help me to anaylyse it .. (gdb) bt #0 0x55a63c98 in ?? () #1 0x00000000 in ?? () (gdb) disassemble 0x55a63c90 0x55a63ca8 Dump of assembler code from 0x55a63c90 to 0x55a63ca8: 0x55a63c90: add %cl,%dh 0x55a63c92: cmpsb %...

Java assert nasty side-effect - compiler bug?

This public class test { public static void main(String[] args) { Object o = null; assert o != null; if(o != null) System.out.println("o != null"); } } prints out "o != null"; both 1.5_22 and 1.6_18. Compiler bug? Commenting out the assert fixes it. The byte code appears to jump directly...

Unreachable code: error or warning?

This is a language design question: Do you think unreachable code (in programming languages in general) should raise a warning (i.e. "report problem and compile anyway") or an error ("refuse to compile")? Personally I strongly feel it should be an error: if the programmer writes a piece of code, it should always be with the intention o...

Automatically adding Enter/Exit Function Logs to a Project

I have a 3rd party source code that I have to investigate. I want to see in what order the functions are called but I don't want to waste my time typing: printf("Entered into %s", __FUNCTION__) and printf("Exited from %s", __FUNCTION__) for each function, nor do I want to touch any source file. Do you have any suggestions? Is ther...

Where are the preferred argument conversions for overloaded methods documented (if at all)?

In other words, what are the precise rules for how the Java compiler determines which overloaded method to choose to execute? I've spent a good amount of time googling and I think I'm not using the right search keywords. public class C1 extends C2 {} public class C2 extends C3 {} public class C3 {} public class Test { public st...

setting up netbeans for c

i am really getting annoyed all i want to do is setup a compiler for c in netbeans - i donwloaded and followed the instructions for MiniGW, and now whenever i try to comnpile a programme it says ""Resolve missing native build tools" and the make command and debugger command fields are empty - can anyone help if not can someone tell ...

How much impact does use of 'var' have on performance of C# Compiler?

I find the var keyword greatly helps in reducing noise in my C# code, with little loss of readability; I'd say that I now use explicit typing only when the compiler forces me to. I know that using var does not change the runtime characteristics of my code. But the question has just occurred to me: am I paying a big penalty at compile ti...

Autoconf ignores compiler flags

I'm trying to build a C library with a non-native architecture. I'm running OSX 10.6 (which is x86_64) but I need the library compiled for i386. Normally, you can just add the compiler flag: -arch i386. But I'm using Autoconf and it ignores this in the configure file and it also ignores it if I try running: ./configure CC="gcc -arch i386...

What does the error "the exec task needs a command to execute" mean?

When compiling a project in Visual Studio, the error message "the exec task needs a command to execute" appears, with no line number. What does this error mean? (Apologies for asking and answering my own question; I just found an answer as I was writing this. Have made it community wiki, so as not to offend.) ...

Refactoring C++ code to use forward declarations

I've got a largeish codebase that's been around for a while and I'm trying to tidy it up a bit by refactoring it. One thing I'd like to do is find all the headers where I could forward declare members, instead of including the entire header file. This is a fairly labour intensive process and I'm looking for a tool that could help me fi...

What kind of advantages are there to changing 'cond' to be a special form

What kind of advantages are there to changing 'cond' to be a special form instead of syntactic sugar? ...

Closure conversion and separate compilation of higher-order function calls

Is there a standard way of dealing with the interaction between separate compilation and different kinds of closure conversion when compiling higher-order function calls? I know of three function-like constructs that are distinctly compiled in most programming languages: closures, (top-level) functions, and C++-style function objects. S...

What is the common name for declaration, definition, expression and statement?

If established name doesn't exist, what name you can suggest? ...

I want to create a compiler with Coco/R and support IntelliSense

I am a beginner in Compiler Engineering and I just want to know how to support IntelliSense. ...

"==" Operator Doesn't Behave Like Compiler-generated Equals() override for anonymous type

According to the MSDN: Because the Equals and GetHashCode methods on anonymous types are defined in terms of the Equals and GetHashcode of the properties, two instances of the same anonymous type are equal only if all their properties are equal. However, the following code demonstrates the compiler generated implementatio...

math.h ceil not working as expected in C

How come ceil() rounds up an even floating with no fractional parts? When I try to do this: double x = 2.22; x *= 100; //which becomes 222.00... printf("%lf", ceil(x)); //prints 223.00... (?) But when I change the value of 2.22 to 2.21 x *= 100; //which becomes 221.00... printf("%lf", ceil(x)); //prints 221.00... as expec...