compiler

Best win32 compiled scripting language?

What is the best compilable scripting language for Win32? I prefer .EXE's because I don't want to install the runtime on the servers first (my company administrates many via remote), but I need to be able to do things like NTFS permissions and (if possible) APIs over the network. There was a small Perl which appeared to be able to do m...

Prevent implicit import of units in Delphi packages

Is there a way to prevent packages in Delphi to implicitly import units that are not listed in the "Contains" list? I'm looking for a compiler directive that makes the build to fail if it tries to do an implicit import. Problems occur when you install a package into the IDE that implicitly imports unit A and then you try to install anot...

MinGW "stdio.h : No such file or directory"

I am trying to use MinGW to compile a C program under Windows XP. The gcc.exe gives the following error: stdio.h : No such file or directory The code (hello.c) looks like this: #include < stdio.h > void main() { printf("\nHello World\n"); } I use a batch file to call gcc. The batch file looks like this: @echo off set OLDPATH=%...

Same source code on two machines yield different executable behavior

Here's the scenario: A C# Windows Application project stored in SVN is used to create an executable. Normally, a build server handles the build process and creates builds at regular intervals which are used by testing. In this particular instance I was asked to modify a specific build and create the executable. I'm not entirely sure ...

Produce conditional compile time error in Java

I do not mean the compile errors because I made a syntax mistake or whatever. In C++ we can create compile time errors based on conditions as in the following example: template<int> struct CompileTimeError; template<> struct CompileTimeError<true> {}; #define STATIC_CHECK(expr, msg) { CompileTimeError<((expr) != 0)> ERROR_##msg; (void)...

C++ Editor, Compiler, Debugger on Windows ( Lighter than Visual Studio)

What would be a good alternative to Visual Studio ? Free or non-free, but a free program definitely makes a better choice. So what do you guys use ? If anything like that exist... ...

Where are static variables stored (in C/C++)?

In what segment (.BSS, .DATA, other) of an executable file are static variables stored so that they don't have name collision? For example: foo.c: bar.c: static int foo = 1; static int foo = 10; void fooTest() { void barTest() { static int bar = 2; static int bar = 20; foo...

What is the best c complier for the Pic18 micro

We are starting a new project based a microchip PIC18F252. What is the best 'c' compiler to use? ...

What does a just-in-time (JIT) compiler do?

What does a JIT compiler specifically do as opposed to a non-JIT compiler? Can someone give a succinct and easy to understand description? ...

Switch vs if-else

What's the best practice for switch vs if for a 30 unsigned enumerations where about 10 have an expected action (that presently is the same action). Performance and space need to be considered but are not critical. I've abstracted the snippet so don't hate me for the naming conventions :p // numError is an error enumeration type, with...

Why is foo(n++, n) not working?

Here is a test case: void foo(int i, int j) { printf("%d %d", i, j); } ... test = 0; foo(test++, test); I would expect to get a "0 1" output, but I get "0 0" What gives?? ...

What are the common undefined/unspecified behavior for C that you run into?

An example of unspecified behavior in the C language the the order of evaluation of arguments to a function. It might be left to right or right to left, you just don't know. This would affect how foo(c++, c) or foo(++c, c) gets evaluated. What other unspecified behavior is there that can surprise the unaware programmer? ...

Combo Box Item comparison and compiler warnings

In VisualStudio (Pro 2008), I have just noticed some inconsistent behaviour and wondered if there was any logical reasoning behind it In a WinForms project, if I use the line if(myComboBox.Items[i] == myObject) I get a compiler warning that I might get 'Possible unintended references' as I am comparing type object to type MyObject. F...

What is the strict aliasing rule?

When asking about common undefined behavior in C, souls more enlightened than I referred to the strict aliasing rule. What are they talking about? ...

Would Automatic Casts be useful?

Is there any downside or problem potential to change the Java compiler to automatically cast? In the example below the result of list.get(0) would automatically be casted to the type of the variable hi. List list = new ArrayList(); list.add("hi"); String hi = list.get(0); I know that generics allow you to reduce casting but they do so...

Why are we still using compiler command lines?

I've been designing a compiler framework (targeting .NET) for a while now and I've been thinking more and more about deprecating the command line interface. A lot of my compiler's flexibility comes from the ability to define custom pipeline elements (to handle DSLs, macros (which have their own DSL to define), etc) and the command line ...

One-click compilers

Do you know of any compilers that only requires one or two clicks on the source code to compile? Having to configure it to do it doesn't count, nor does having to go to a terminal and write a word or two. Extra points are given if you can give your own view as to why so few compilers have a gui included, or just a send to compiler listi...

Can you use the Phoenix compiler as a more powerful NGEN?

In case you don't know of Phoenix, it's a compiler framework from Microsoft that's apparantly going to be the foundation of all their new compilers. It can read in code from CIL, x86, x64, and IA64; and emit code in x86, x64, IA64, or CIL. Can I use it to transform a pure .Net app into a pure native app? By which I mean, it will not hav...

How do you increase the maximum heap size for the javac process in Borland JBuilder 2005/2006

In most modern IDEs there is a parameter that you can set to ensure javac gets enough heap memory to do its compilation. For reasons that are not worth going into here, we are tied for the time being to JBuilder 2005/2006, and it appears the amount of source code has exceeded what can be handled by javac. Please keep the answer specifi...

I want tell the VC++ Compiler to compile all code. Can it be done?

I am using VS2005 VC++ for unmanaged C++. I have VSTS and am trying to use the code coverage tool to accomplish two things with regards to unit tests: See how much of my referenced code under test is getting executed See how many methods of my code under test (if any) are not unit tested at all Setting up the VSTS code coverage tool ...