compiler

ELF File Format

I'm attempting to manually load the hexdump of an elf file that I compiled using g++ into a processor simulation I designed. There are 30 sections to a standard elf file and I am loading all 30 segments with their proper memory location offset taken into account. I then start my program counter at the beginning of the .text section (0040...

Convert C++ Code to Assembly for SPIM

I'm having a lot of trouble getting my compiled assembly file working on SPIM. Basically I want to write a c++ file, and then generate a .s file that I can open in SPIM without error. This means that the assembly must be in MIPS32 ABI using MIPS I instructions (some MIPS II). How do I do this? Right now I'm using g++ but I'm having m...

JIT complier and execution

I'm confused with JIT compiler, What is JIT compiler? JIT compiler compiles byte codes before each execution or each time JVM loads? ...

How to get printf style compile-time warnings or errors

I would like to write a routine like printf, not functionally-wise, but rather I'd like the routine to have the same time compile check characteristics as printf. For example if i have: { int i; std::string s; printf("%d %d",i); printf("%d",s.c_str()); } The compiler complains like so: 1 cc1plus: warnings being treated a...

How do I increment an enum in VS C++ 6.0?

I copy and pasted some code that increments an enum: myenum++; This code worked fine as it was compiled in VS.NET C++ 2003 I am now developing in VS 6.0 and get the error: error C2676: binary '++' : 'enum ID' does not define this operator or a conversion to a type acceptable to the predefined operator How can I get t...

Is there a detailed tutorial on creating a multipass language translator using ANTLR?

I have been through the ANTLR tutorial series by Scott Stanchfield and am also going through the ANTLR book... My project requires me to build a multipass language translator to translate code from one language to another both the languages are similar in syntax with the difference being that the source language has support for classes a...

How do clojure programs/compilers/interpreters actually "work"?

It seems that to install Clojure in every new IDE, I have to completely re-install it and create a copy of it. And running the REPL seems like it's running a Java program. I'm coming from a Ruby background, where Ruby programs are run by ruby program.rb, and the ruby being a program executed from one place, onto the file (I am aware th...

How many passes over the code does gcc use?

Specifically for C and C++, how many passes are used by default? Does this number change depending on the level of optimization used? (it should) Can it be changed directly? I was searching for this information in http://gcc.gnu.org/, but googling using site:http://gcc.gnu.org/ did not yield anything. Any pointers to any documentati...

Zend Engine and Php Ext Folder

Hi Guys, Php has a Zend Engine.. The zend engine provides fopen.. Php also provides fopen... But when we call fopen, php's fopen is called.. I have three questions here What is the purpose of the /php--Nn/ext folder . Do the functions in ext folder need to be recompiled everytime they are changed? Do the functions in the ext folder ...

How can I get the compiler tell me what file #define a value?

My code is linking against several other libraries that are also developed at my company, one of these libraries is redefining several values from errno.h, I would like to be able to fix this, however I am having trouble finding the exact file that is redefining these values, I am want to know if there is a way to make the compiler tell ...

How to disable VS compile warning "class or css class is not defined"

In VS 2008, when I compile, I get a large series of The class or CssClass value is not defined messages. How do I get the error/warning code (something like "C0167") for that message, so I can disable it? Answers that won't work: The compiler gives you the warning number. No, it doesn't. See the list of MSDN compiler errors (found a...

header files. class and aplication of stacks

when i put the header file in the same folder of the source code. the program doesnt compile. it shows errors. like:7 E:\data structure\asig 5\code.cpp `Queue' has not been declared driver for queue adt. code.cpp #include <iostream> #include "QueueLnk.h" using namespace std; // ********************* Function Prototypes **************...

Interpreter in Python: Making your own programming language?

Remember, this is using python. Well, I was fiddling around with an app I made called Pyline, today. It is a command line-like interface, with some cool features. However, I had an idea while making it: Since its like a "OS", wont it have its own language? Well, I have seen some articles online on how to make a interpreter, and parser, ...

Is there a DCC32.exe command line switch to make it use/create .dcu files?

When compiling a Delphi project calling DCC32.EXE from a script, no .dcu files are generated. Is there a command-line switch (or .cfg setting) to make the compiler create dcu's? Will the compiler then also check the .pas file and re-create the .dcu if the source has changed? (I've seen there's a similar question for the Delphi 6 compil...

Why is creating a 64bit Delphi so hard?

The Internet is full of developers requesting a 64bit Delphi, and users of Delphi software requesting 64 versions. delphi 32bit : 1.470.000 pages delphi 64bit : 2.540.000 pages :-) That's why I've been wondering why Embarcadero still doesn't offer such a version. If it was easy to do, I'm sure it would've been done a long time ago...

Can gcc generate different size object code ?

Which option should be enabled in gcc to generate 16-bit or 32-bit or 64-bit object code ? Are there separate options for generating each of the above object code type ? ...

How long does Glibc take to compile?

I've been compiling it in a virtual machine for over 8 hours now and it still hasn't finished. The terminal is still printing things so I know it's still compiling. The host system is a 2.10Ghz Intel Core2Duo with 4GB RAM and the guest is Linux on a PowerPC virtual machine (QEMU) one with 1GB RAM. I know the dynamic instruction transl...

Is it possible for Visual C++ 2008 Express Edition to compile C source code?

I wish to learn C so that I can understand the concepts behind many major programming languages without the shortcuts that C++ has, or the garbage collectors that Java has. I plan on learning C and then going to C++, and I am currently studying Computer Science. In anycase, I was wondering if Visual C++ 2008 Express Edition compiler for...

Weird generics issue

Hello Does anyone know why the following code does not compile and during compilation I get incompatible types exception ? public class Test<T> { public static void main(String[] args) { // using Test<?> solves the compilation error Test test = new Test(); // getting error incompatible types: // found : java.lang.Ob...

reason for methods not being compiled in Hotspot JVM

There are flags available that provide log information on methods that have been compiled. Where is the information on methods that didn't get compiled and why they didn't get compiled? Being able to see how the hotspot compiler makes its decisions and the reasons for it not compiling certain methods would give me a better understandin...