arch detail

arch detail

Monday, September 08, 2008

C++ Irritation

In C++ (compiled with g++), the following will use foo's copy constructor:


foo f;
foo g = f;


Whereas I had really imagined it would use the default constructor, followed by the operator= function if present.

In other news, I am working on interesting stuff but haven't spoken about it yet. See CIL, the C Intermediate Language for a really interesting approach to compiler IR: It uses (a subset of) C as an intermediate language for C.

2 comments:

Aaron said...

What are you doing with CIL?
That's what I used for my list_head inference stuff.

I've also been keeping a close eye on projects like treehydra/dehydra:
http://developer.mozilla.org/en/Treehydra

jmyers said...

I'm using CIL as part of a code obfuscation project for a CS class here at Arizona. I work in a team of two on developing a system for automatically obfuscating C code, and another team works on sending blocks of code from a server to a client, in order to make it more difficult for the client to "cheat" computation as part of a network application.

The canonical example is in a game like World of Warcraft, where we need fairly low network bandwidth (so we cache data and trust computation on a client machine) but where malicious clients can do some level of harm (cheat at the game, make the game not fun).