compiler

What is the difference between javac and the Eclipse compiler?

I asked this in a comment, but figured it's a separate question: Is Eclipse's compiler just a wrapper around the same compiler core that the javac program is wrapped around, or is it a separate compiler altogether? If the latter, why would they reinvent the (possibly inferior) wheel? ...

Why is 'using' improving C# performances

It seems that in most cases the C# compiler could call Dispose() automatically. Like most cases of the using pattern look like: public void SomeMethod() { ... using (var foo = new Foo()) { ... } // Foo isn't use after here (obviously). ... } Since foo isn't used (that's a very simple detection) and si...

<function> referenced from; symbol(s) not found.

I have a piece of C code that is used from a C++ function. At the top of my C++ file I have the line: #include "prediction.h" In prediction.h I have this: #ifndef prediction #define prediction #include "structs.h" typedef struct { double estimation; double variance; } response; response runPrediction(int obs, lo...

Bug in VS2008 compiler : DLL cannot be found

I made some changes to my solution which contains a couple of project and wanted to compile it again .. now it says Metadata file C:\myproject\bin\myproject.DLL could not be found... I closed the VS and opened again and also deleted the bin and obj folder of that project, but still the same compile error... ...

How the C# compiler treats query expressions ?(Dotnet 3.5, C#3.0)

Going thru one of my favourite authors question What’s the hardest or most misunderstood aspect of LINQ? I am basically looking for the answer of the question: How the C# compiler treats query expressions Thanks ...

Does a compiler have an assembler too?

My understanding is that a compiler converts the high level language into machine code. I have a question as to whether a compiler(say VC++) in-turn uses an assembler too? I remember seeing assembly code, whenever there is a crash or something like that. ...

obj-c : iphone programming , Compilation error on 10.6.0

hi, i got an error when i put Mac OS X Deployment Target to 10.6.0 : ld: library not found for -lcrt1.10.6.o Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 but when i use 10.5.0 it works well. i recently deleted my developper folder and reinstalled xcode it is the main cause. b...

Why aren't (C++) virtual destructors enforced for a base class

Destructors aren't virtual by default to not hurt when its not needed, which is fine. But in case of a base class derived class scenario, is there any use case for not having a virtual destructor? If not could it be possible (does it make sense) for the compiler to complain if a class derives from a base class which has a public non vir...

MSVC++ erroring on a divide by 0 that will never happen! fix?

const int bob = 0; if(bob) { int fred = 6/bob; } you will get an error on the line where the divide is done: "error C2124: divide or mod by zero" which is lame, because it is just as inevitable that the 'if' check will fail, as it is the divide will result in a div by 0. quite frankly I see no reason for the compiler to even eval...

Build a Cross Compiler

I'm trying to compile a c++ file and generate an asm or s file to be disassembled and run in PSIM. Whenever I try to do this I get errors. I am attempting to compile to mipsI-linux. I think I've determined that my cross compiler that was given to me is not working correctly for some reason. Can anyone give me some help building a new cro...

Strange compiler behavior with float literals vs float variables

I have noticed an interesting behavior with float rounding / truncation by the C# compiler. Namely, when a float literal is beyond the guaranteed representable range (7 decimal digits), then a) explicitly casting a float result to float (a semantically unnecessary operation) and b) storing intermediate calculation results in a local vari...

Delphi 2007 internal error

I got the following error in Delphi 2007. What does it mean? [DCC Error] uMyUnit.pas(9614): F2084 Internal Error: AV21B66E31-R0000000F-0 I did some recently added code removing, line insertions/deletions, changing compiler options, but nothing worked. I was able to solve this by switching the 'Typed pointer @ operation' option off. In...

Resources on Writing Compiler Backends for OO Languages ?

Greetings Overflowers, I am trying to deeply understand how one can develop an x86 (ia32/ia64) backend for OO languages (staticly/dynamically tryped), mainly to be run on Windows OS. I have a good understanding of the x86 architecture, Windows architecture and how to get a code to the tree level ready to be optimized and serialized int...

What are the highest level languages that can be compiled?

What are the highest level languages that can be compiled to executables? When I say compiled to an executable I am not referring to bytecode, but native assembly code like in the C, C++ sense. EDIT: One issue that I'm having is that clients have ssh access to my server in a limit access acount. They need to run some of my scripts but I...

Disable logging in Java at compile time

I have some Java code that I'd like to instrument with log messages for debugging purposes. The final (compiled) production code, however, should not contain any logging as it would slow down the execution time. Is there any way in Java to disable a logger at compile time? I am not afraid of the footprint a check inside the log method o...

Different behavior of compilers with array allocation

I recently found a interesting behaviour of g++ when compared with MSVC++ 2008. Consider this tiny program: #include <cstdlib> const int ARR_LENGTH = 512; void doSomething( int iLen ); int main( int argc, char** argv ) { doSomething( ARR_LENGTH ); return 0; } void doSomething( int iLen ) { int iTest[iLen]; return; } ...

How to modify the php source code and recompile it?

Hi for my research, i modify the c code that makes the php ( not the code that is written with php but that which actually makes php ). I want some way of compiling it and making it work with apache.. How do i do that? ...

Emitting native code (for a specific platform)

How do you get started generating native code for a target platform? I've got (some) experience and (some) skill in C++, and am interested in going and writing my own compiler (for C++). But I've got little idea how I'm going to turn the end result into native code to execute on my target platform, which at the moment is just Windows, x8...

gcc - 2 versions, different treatment of inline functions

Recently I've come across a problem in my project. I normally compile it in gcc-4, but after trying to compile in gcc-3, I noticed a different treatment of inline functions. To illustrate this I've created a simple example: main.c: #include "header.h" #include <stdio.h> int main() { printf("f() %i\n", f()); return 0; } file....

Delphi conditional compiling

Hello there, I need to know if is there any option to compile a delphi project only if the source or any used unit, package etc has been changed. If this is not possible, second alternative : Is there any option to generate exactly the same binary compiling two times the same project. Thanks. Edit: The usage is for a hash based WebUp...