compiler

Ensuring C++ doubles are 64 bits

In my C++ program, I need to pull a 64 bit float from an external byte sequence. Is there some way to ensure, at compile-time, that doubles are 64 bits? Is there some other type I should use to store the data instead? Edit: If you're reading this and actually looking for a way to ensure storage in the IEEE 754 format, have a look at Ada...

View Compiler Mangled Names in C++

How do I view the compiler-generated mangled names for overloaded functions in C++? I'm using VC9 but answers for other compilers are welcome too. Edit: I find all the answers useful here. Accepting the one I liked best. ...

Reading/Writing machine code

I am not well acquainted to the compiler magic. The act of transforming human-readable code (or the not really readable Assembly instructions) into machine code is, for me, rocket science combined with sorcery. I will narrow down the subject of this question to Win32 executables (.exe). When I open these files up in a specialised viewer...

C to IEC 61131-3 IL compiler

I have a requirement for porting some existing C code to a IEC 61131-3 compliant PLC. I have some options of splitting the code into discrete function blocks and weaving those blocks into a standard solution (Ladder, FB, Structured Text etc). But this would require carving up the C code in order to build each function block. When l...

Bug in eclipse compiler or javac?

Who is right? Eclipse or javac? --------------- c/v/A.java --------------- package c.v; public class A<T> { } --------------- c/v/B.java --------------- package c.v; public class B extends A<B.Secret> { private class Secret {}; } Eclipse compiles B.java just fine. Javac has a problem. $ javac c/v/B.java c/v/B.java:3: c.v.B.Sec...

VC++ compiler and type conversion?

When I moved a program from a Mac to this Windows PC, the VC++ 2008 compiler is giving me errors for passing unsigned ints to the cmath pow() function. As I understand, this function is not overloaded to accept anything but floating-point numbers. Is there some compiler flag/setting that will ignore these errors? Also does anyone know h...

Determining Which Compiler Built a Win32 PE

How can one determine which C or C++ compiler was used to build a particular Windows executable or DLL? Some compilers leave behind version strings in the final executable, but this seems to be rarer on Windows than on Linux. Specifically, I'm interested in distinguishing between Visual C++ and the various MinGW compilers (usually fairl...

Delphi Region compiler directive - backwards compatible unit files?

Given the desire to use the useful Region compiler directive in unit files, what's the best approach to allow these same units from being used in previous versions of Delphi? There doesn't seem to be a 'decent' approach. (Desired IDE version is Delphi 7) I like having Regions above the method definitions to hide/display the method defi...

Is a compiletime constant index into a compiletime constant array itself compiletime constant?

I am trying to play fancy games which have the C++ compiler synthesize hash values of constant strings at compiletime. This would let me replace the string with a single identifier, with a massive savings in code size and complexity. For programming clarity and ease, it'd be awesome if I could examine and compute at compiletime with sim...

What is the difference between make and gcc?

The last sentence in the article caught my eye [F]or C/C++ developers and students interested in learning to program in C/C++ rather than users of Linux. This is because the compiling of source code is made simple in GNU/Linux by the use of the 'make' command. I have always used gcc to compile my C/C++ programs, whereas...

Python - Parse a .py file, read the AST, modify it, then write back the modified source code

I want to programmatically edit python source code. Basically I want to read a .py file, generate the AST, and then write back the modified python source code (i.e. another .py file). There are ways to parse/compile python source code using standard python modules, such as ast or compiler. However, I don't think any of them support way...

Any good current cross-platform reference for UNIX compiler/linker options?

I have used this summary reference for years but it is beginning to show its age. If you have any you might suggest as more current I would greatly appreciate it. ...

What is the difference between Cygwin and MinGW?

I want to make my C++ project cross platform, and I'm considering using Cygwin/MinGW. But what is the difference between them ? Another question is whether I will be able to run the binary on a system without Cygwin/MinGW ? ...

Does anyone know how or where can VADS (Verdix Ada Development Studio) can be obtained?

Yeah, I know is obsolete and old and everything you all might say... But I just needed... This stuff happens... xD any clues? ...

dll release debug

Is it possible to have a project reference one DLL when compiling in DEBUG mode, and another DLL when compiling in RELEASE mode? See, we've got a number of legacy projects we want to go ahead and remove from the solution, and just keep the DLLs around as references until we can eliminate all of the references altogether. ...

C or C++ compiler for the Tandy 1000 PC SX?

I have my dad's old PC from the 1980's. It's a Tandy 1000 PC SX: This computer doesn't have a modem, but I have another PC that has Windows XP on it and it also has a 5 3/4 inch floppy drive. So where can I find a C/C++ compiler for this old PC? If you don't help me I'll be forced to program in GW-BASIC. ...

Thompson's Trojan Compiler

I'm trying to grasp a better understanding of Thompson's Trojan Compiler (discussed in his 1984 ACM Turing Award speech "Reflections On Trusting Trust"), and so far this is how I understand it: "The original login program for Unix would accept whatever login and password the root instructed it to. It would only accept a certain password...

Generating object file to separate directory using g++ compiler - C++

I use the following code to compile a cpp file to object file. g++ -c main.cpp Above code generates the .o fles in same directory where main.cpp resides. Suppose I have a folder named obj and need to generate the object files there, how do I write? How can I see the compiler switches supported by g++ and it's usages? Any help wou...

Which languages compile to CIL / MSIL

Most of the lists I have seen comprise: C# VB.Net Other .NET language What languages fall into the "Other" category? I've come across: Delphi C++ Cobol.Net Chrome I'm sure there must be others? ...

What C compilers have pointer subtraction underflows?

So, as I learned from Michael Burr's comments to this answer, the C standard doesn't support integer subtraction from pointers past the first element in an array (which I suppose includes any allocated memory). From section 6.5.6 of the combined C99 + TC1 + TC2 (pdf): If both the pointer operand and the result point to elements of t...