« Noch ein bischen Werbung bevor es weitergeht | Main | Tracer seems to be working. Bugs in Carbon ? »

void * and & and C lameness

I don't know who specified it, but that you can't use & on pointers is a major lameness in C.

Especially with addresses you want to mask off bits, and you now always have to cast to an integer and then back again. The problem is though, which integer ? Traditionally on UNIX one used int, but that f.e. never worked well on the Atari ST f.e., where int was defined on some compilers to be 16 bit. With the advent of 64 bit computing, it remains to be seen if all compilers will promote long to 64 bit, so logically one should be using unsigned long long, but that is just horrible :)

One reason, why you may not be able to use & on pointers, might be because you couldn't use AND on address registers on some CPUs like the 680000. but then C was developed for the PDP-11 and I don't know that machine at all.

It is also none none none convenient, that you can't say (void *) p + 12. I suspect some PASCALers were on the committee when this was discussed. :)

[Playing right now: Gasoline from the album "Audioslave" by Audioslave]

Comments (6)

poop:

first post!

java roxx:

Try Java instead! It makes live so much easier without its distinct notion of pointers (although it's full of them all the time - just as in java.lang.NullPointerException, my favourite). I think Java was especially designed for such whiners as you. :-)

Anonymous Coward:

Well, and HOW does *that* relate to XUL ?? Fix your arguments ! JavaScript doesn't even know about that "long long" thing or what that junk is you are talking about. How the hell are you addressing the thing you are calling "address register" in XML ??? And AFAIK Mozilla does not even run on PDP-11 anyway.
Jerk.

PS: Everybody knows that Amiga was far superior to Atari ! So who wonders that it can't even deal with JavaScript !

zealot:

Yeah, AmigaOS4 will be definitely crushing! Who remembers Atari anyways?

Nat!:

Ugh, I left comments on.

Sorta like forgetting to turn off the light in a room with the window open on a warm summer night. You come back and find out you've become infested. :)

C64:

just 2 things:

- what's an 680000 CPU? 10 68000's clustered?
- it you want to abbreviate 'for example', please please please use 'e.g.' (latin for exempli gratia"), not 'f.e.'

About

This page contains a single entry from the blog posted on June 10, 2003 7:50 PM.

The previous post in this blog was Noch ein bischen Werbung bevor es weitergeht.

The next post in this blog is Tracer seems to be working. Bugs in Carbon ?.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 4.25