compiler

Are compilers allowed to eliminate infinite loops?

Can optimizing compiler delete infinite loops, which does not changes any data, like while(1) /* noop */; From analyzing a data flow graph compiler can derive, that such loop is "dead code" without any side effects. Is deleting of infinite loops prohibited by C90/C99 standards? Does C90 or C99 standards permit compiler to deletin...

Statically linked application - invalid or corrupt dll

I have an application that uses the winInet classes - #include <afxinet.h> and the wininet.dll I would like to statically link the WinInet function calls in my application as well as the dll, so I followed these steps. I then copied the wininet.dll into my project directory, as I read here. Upon building I get the following error -...

haru library - adding to my compiler

i already downloaded a haru library but it seems i can't find the lib folder for me to link the library of haru to my compiler (dev c++).. can anyone tell me on what forlder of libharu will be added to my compiler directory for me to not have a 'linker error' when i run the sample demo of haru.. ...

Building an iPhone OS 2.2.1 project fails with error

Maybe someone knows what this means? error: can't exec '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2' (No such file or directory) I wanted to use LLVM GCC 4.2 compiler because an Apple guy said that's the best one. I guess LLVM GCC 4.2 does not work with iPhone OS 2.2.1 framework? ...

Any Framework to build a code checking website(like SPOJ) ?

Hi guys, My col is planning to conduct a online coding competition.. Im now looking for a framework that checkes user's code and returns the appropriate result.. Only C,C++ support is enough.. -Dinesh ...

Java to C cross compilation ...

Does anyone know of a good Java to C cross compiler? Do they work well? ...

must declare a body because it is not marked abstract or external - error thrown from aspx page w/ no code behind

I have a .Net app running in IIS6. The app dlls are compiled against the 3.5 framework, which is installed on the server. The app works. I hit an aspx page that has no codefile; it is an .aspx page only, which has inline code in tags. Code declares auto properties as such: protected String PlaylistUrl { get; set; } When I request the...

How is release handled for @synthesized retain properties?

I have some questions about synthesized properties in Objective-C. The full list follows, but the basic question is this: How does the compiler ensure that the ivars for synthesized properties are properly released, even though my code may or may not include release methods in dealloc? Note: I decided not to post these as individual que...

Is there rule of thumb for catching errors in Lex/Yacc parsing?

Should we catch errors while parsing general purpose language as early as possible (in Lex) or where it is more convenient and give us more information (in Yacc)? How various languages solve this problem? ...

Flash CS4 refuses to let go

I have a flash project; it has many source files. I have a fairly heavily-used class, call it Jenine. I recently (and, perhaps, callously) relocated Jenine from one namespace to another. I thought we were ready - I thought it was time. The new Jenine was better in every way - she had lost some code bloat, she had decoupled herself from a...

VB.NET Select Case Compiler Optimizations?

Does the VB.NET 2008 compiler selectively optimize Select Case Statements? For example, a Select Case Statement with a sufficient quantity of integer cases could be organized as a binary search. I ask this because I am curious whether or not I should opt for a Select Case in place of If Statements with multiple Else If's where integer...

Why is (void) 0 a no operation in C and C++?

I have seen debug printfs in glibc which internally is defined as (void) 0, if NDEBUG is defined. Likewise the __noop for Visual C++ compiler is there too. The former works on both GCC and VC++ compilers, while the latter only on VC++. Now we all know that both the above statements will be treated as no operation and no respective code w...

Does a cross-platfrom compiler that can compile a native executable that can be run both in linux windows exist? Could it exist?

I remember a few years ago(2002) there was a multipartite virus that could be run natively on linux and windows. I don't know if a compiler could be specially craft an executable so that it could be read as both ELF and PE, so that the os would start executing at different entry points. Or a program that could merge two programs, one com...

Static methods and instance methods in memory

How are those different Method types handled in memory. I found two different explanations to this: Static methods are only once in memory, whereas instance methods are in memory multiple times, one for each instance to handle the references to membervariables correctly in each instance. All methods are only once in memory and instanc...

MS Visual Studio Project header files...

I am fairly new to developing C/C++ code in MSVS but one of the things that has already confused me is why, after adding a set of source and header files to my project such that they show up respectively under the MSVS folders 'Source Files' and 'Header Files', do I subsequently have to tell the compiler where my header files are under '...

failing to compile a project, missing io.h file

Hello, I fail to compile a C++ project for mobile device with Windows Mobile (Windows CE-based) operating system and Visual C++ compiler from Visual Studio fails with: Error 1 fatal error C1083: Cannot open include file: 'io.h' EDIT I am trying to compile the SQLite amalgamation, the shell.c file includes the call to this io.h bu...

SUNWspro compiled file - detect verison of compiler

Hello I have a file, compiled by SUNWspro (Sun pro complier) for SPARC/Solaris. How can I detect version of compiler used to build this binary? ...

Strange, Sudden compiler fail error in Xcode for iPhone dev

What is the following error caused by? I did not make any significant changes and suddenly it started appearing: Linking /Users/JimB/Desktop/iPhone Dev/Games4Kids/build/Debug-iphonesimulator/ETFanClub.app/Games4Kids(1 error) duplicate symbol .objc_category_nameNSString_HTTPExtensions in (path)ViewController3 and (path)ViewController1...

C# compiler doesn’t optimize unnecessary casts

A few days back, while writing an answer for this question here on overflow I got a bit surprised by the C# compiler, who wasn’t doing what I expected it to do. Look at the following to code snippets: First: object[] array = new object[1]; for (int i = 0; i < 100000; i++) { ICollection<object> col = (ICollection<object>)array; ...

Sun Studio 12 C compiler for Linux is so slow

I download and tried it today. It compiles my project but "suncc" is even slower then "gcc" which is famous for its leisureliness. I just -xO1 which i thought should do no optimizations. I have a lot of inline declared C functions. Is there a way to disable the inlining or anything else to make it compile faster. ...