compiler

How can a pointer be implemented except storing an address?

Recently I answered another question asking for questions every decent C++ programmer should be able to answer. My suggestion was Q: How does a pointer point to an object? A: The pointer stores the address of that object. but user R.. disagrees with the A I propose to the Q - he says that The correct answer would be "it's implementati...

Why there's no dedicated compiler for c or c++?

Seems all compilers can deal with both c and c++,like gcc ,msvc... Is it because these 2 languages are exactly very much alike? ...

warning: left-hand operand of comma expression has no effect

i see this warning How to do fix it? Temp += (Table[i, temp3] - (MSB[i] ^ 0x1)); warning: left-hand operand of comma expression has no effect ...

How to write a simple compiler in C/++?

Possible Duplicate: Learning to write a compiler Hi Stack Overflow, now don't get me wrong, I don't intend to write a compiler for C++(though I intend to write it in C++) or Java or some other high level complex programming language. I just want to learn the basics of converting a basic instruction set into a Windows Executab...

Are these kinds of analysis for efficient use of stack frame memory slots possible ?

I know a compiler may detect life-time of different variables of a function and use the same stack frame slot for some different variables if it detects at beginning of life-time of each one of them life-time of previous variables has ended; but in case of local objects of classes in a function may it analyze life-time of members individ...

How to resolve shift reduce conflicts in my grammar?

I'm writing a compiler from (reduced) Pascal into ARM asm. I'm at the second step of the process - after writing lexical analyzer now I'm working on syntax analysis with java cup. I have written my grammar, but got 5 S/R conflicts, which are all very similar. Example: Warning : *** Shift/Reduce conflict found in state #150 between a...

Which one of these two ways of writing this code would be more suited?

I've got a code that as you can see I can write in either of two following ways, the matter is the only difference is since in second function the parameter is declared as non-constant I can use that instead of declaring a new variable(num1 in first function) but I' curious which one would be more suited if there would be any difference ...

In what cases does out-of-order execution result in more efficient code

I'm trying to understand how the Memory barrier works, why it is used and in what cases it should be used. However I'm not entirely sure in what cases it would be more efficient to arrange the order of instructions, can anyone give me an example of that? ...

Why do almost all OO languages compile to bytecode?

Of the object-oriented languages I know, pretty much all but C++ and Objective-C compile to bytecode running on some sort of virtual machine. Why have so many different languages settled on compiling to bytecode, as opposed to machine code? Is it possible in princible to have a high-level memory-managed OOP language that compiled to mach...

A program that gets Delphi source code, and then transforms it into Objective-C code is a compiler? Or a source code transformer?

I got in this argument at work. My coworker told that just something that generates machine code is a compiler. Then (after I mentioned the Google Closure Compiler) he changed his mind: apparently, for him, a compiler is something that generates optimized source code in any language (which doesn't make sense, since optimization is an opt...

Issues with building PROC application using Oracle 10g 64 bit

Hi All, I am trying to build my PRO* C application in 32 bit mode using Oracle 10g 64 bit on Solaris SPARC platform. Can someone tell me what settings has to be made inorder to successfully compiler and create an executable? Currently when i switch my LD_LIBRARY_PATH=$ORACLE_HOME/lib32, proc fails with the following error ld.so.1: pr...

Access to data, BSS segments will be through using a pointer or by intructions directly addressing ?

I know when it's a matter of accessing memory of a stack frame it'll be through using stack frame pointer but I wonder about how the access to data, BSS segments containing global/static data will be, through using a pointer like stack frame pointer indicating starting point of those segments or instructions address pieces of those segme...

xcode seems to ignore preprocesser flags

I've seen all the posts about setting preprocessor flags via the "Preprocessor Macros" setting. For some reason, Xcode seems to ignore my settings. I'm building an Xcode project that was created via CMake. Inside the Dependencies.cmake file, there are a few definitions added. For example: add_definitions(-DUSE_POCO) add_definitions...

Compiling source code in debug mode using a CodeDomProvider

I have some source code I'd like to compile using the Microsoft.CSharp.CSharpCodeProvider class, and I want to include stuff that's specific to debug builds (e.g., methods marked with the [Condtional("DEBUG")] attribute). I tried setting the CompilerParameters.CompilerOptions property to "/debug", but when I ran the compiled code the de...

will compiler reserve memory for this object?

I have following two classes: template <size_t size> class Cont{ public: char charArray[size]; }; template <size_t size> class ArrayToUse{ public: Cont<size> container; inline ArrayToUse(const Cont<size+1> & input):container(reinterpret_cast<const Cont<size> &>(input)){} }; I have three following lines of code at global scope: c...

Advanced debugging with dev-c++

I am normaly using Visual Studio 2008 Express, which is quite powerful, but some geeks in head of competition in programming said that we are allowed to use only Dev-C++ as compiler ( I know it's smaller but I think that competition should be about testing your skills in writting code not using all kind of compilers). Anyway in VS2008, e...

Is there any free portable (meaning <100mb ) IDE for C++ windows developers with compiler capable of codehinting and tested working with Win32 API?

What I need is a small sized IDE+compiler for creating C++ applications that will interact with win32APIs... And It'd be grat for it to be capable of analizing headers I give it for code completion and connecting DLL's (not .Net DLLs but If it'd be capable ofcompiling C++ .NET projects I would just be super-duper glad) to project should ...

Using VB 6.0 Form in .net which is embeded in a DLL

i have a DLL of a VB 6 Project that has one class n a form............. the form is called from that class when its constructor is called..........i maked DLL on whole project......add that DLL in my .NET project references.....now when i call that class of that DLL.....it give following error Creating an instance of the COM component w...

cross compile (arm-none-eabi-as) arm assembly error "junk at end of line /" or undefined symbol

Hi while i cross compile an startup.s file (arm-none-eabi-as file.s) (*-gcc) I am getting in each commentary line some errors - junk at end of line, first unrecognized character is / when i delete the // some comment lines i get errors about undefined symbols even i defined them at beginning of the file. anyone know whats wrong? ...

url parameters in Command Line

i am trying to make a pdf file with wkhtmltopdf when i pass url www.example.com pdf is generating or www.example.com?id=1 but when i try to put another parameter command execution is not working www.example.com?id=1&type=u shell_exec("c:\pdf\wkhtmltopdf.exe http://localhost/test/index.php?id=1&amp;typee=abc test.pdf "); i t...