Older blog entries for johnm (starting at number 12)

I looked at the calendar today, and it turns out that I've been back from New Zealand for four weeks now. That's hard to believe: I haven't achieved a great deal in all that time, and it sucks to be back.

There's an interesting post on the binutils list about printf as a macro:

printf ("%*s",
#ifdef BFD64

If printf is a macro, this is nonportable because the preprocessor is not required to be able to handle directives while it's reading the arguments in a macro invocation (ISO/IEC 9899:1999 6.10.3 para 11). In particular, current GCC doesn't handle it.

But what kind of freak would define printf as a macro?

It turns out that doing that is valid: (ibid 7.1.3, and the same language is in C89 too)

[U]nless explicitly stated otherwise [for that function] [...] Any function declared in a header may be additionally implemented as a function-like macro defined in the header

Perhaps it's just me, but I find that surprising. I knew simple things like abs() were allowed to be macros and expected them to be, but I didn't realise the implementer was allowed to provide macro versions of pretty much everything. I'm sure I've written code like the above in the past (or maybe it was just with my own functions, but I don't think so).

The obvious fix is to write the whole printf twice. There's two other solutions too: one cute (but possibly hard on moronic maintainence programmers), and the other surprising at first that it is acceptable, but not when you think about it. IMHO.

The nice thing is that the standard actually tells you all about these solutions. That's unusually friendly for the C standard. :-)

Long long ago, I had a friend who did a late show on our student radio station. Sometimes I would go along to the studio and he would put "Walking down Madison" on the radio for me. But we're not in touch any more, and there won't be any more songs from Kirsty MacColl.

I don't have a story like Rachel's. Only that I could have seen Kirsty in concert in some small venue in London once upon a time, but I didn't go along that night. Only memories of some private episodes in my life that have songs from her earlier albums as their soundtracks.

I go back to New Zealand for a while on Saturday, and I'll be bringing my copy of Kite back to the Bay Area in the new year.

"Open the door and look up to the skies / And leave the shore / And let my hand trail in the cool water / Float downstream, say goodbye to that dream"

15 Dec 2000 (updated 15 Dec 2000 at 15:44 UTC) »

David A. Desrosiers, who sometimes calls himself hacker, writes:

Palmsource 2000 is winding down
I was asking them some pretty heavy questions about their position on linux and unix support with Bluetooth. They were hesitantly evasive
Again, somewhat evasive
Ugh. They're so blind sometimes.

Sometimes, David, I wish you would be a little less confrontational and perhaps give people the benefit of the doubt occasionally. "Hesitantly evasive" usually means that the person hasn't previously considered the point you've raised, doesn't want to give an implicit commitment to something that they haven't thought through, wants to be helpful so wants to avoid a flat NO, can't give you a full answer for stupid confidentiality reasons but doesn't want to turn you away, isn't involved in that area and doesn't know what other people in the rapidly expanding company might have already done in that area, or generally a combination of all of the above.

I happen to know all of the people in the talks you mentioned, and I can tell you that it's not very fair to accuse them of being evasive or blind. On the contrary: they're all very keen to help people's cool ideas become reality. Your cool ideas, so don't alienate them! :-)

A lot of engineers work at Palm. Not all of them know much about what we're doing with Linux or with free software, but that doesn't mean that it's not happening. All of my work and Keith's work is free software and runs on Unix. I think David knows that there are many people -- such as Kenneth, Flash, and me -- inside Palm who care about pilot-link a lot. We also spend a lot of time evangelising for these things within the company.

To be perfectly honest, it's kind of hard to stay motivated to fight the good fight when people oversummarise and tell you you're blind and you get close to zero support or assistance from the community for your open projects!

In other news, in the labs tonight the Llamagraphics people showed me another bug in CodeWarrior which partially screws up something we're trying to do in our SDK (yeah, that one that David's going to interrogate me about tomorrow). It whines that you can't do this static_cast with an incomplete type:

struct S;
S* foo (void *pv) { return static_cast<S*>(pv); }

By my reading of the C++ standard, this violates paragraph 10 of 5.2.9 ("Static cast"), in particular because a pointer to an incomplete struct type is indeed a pointer to an object type (3.9 paras 6, 9), and see also 3.2 para 4 (and pretend it's decreeing the converse :-)).

Bah. Fortunately, while walking back to the office after talking to Catherine and Stuart, I realised there's a workaround for full on C++ programmers who don't want to fall back to a C-style cast: use reinterpret_cast. Okay, so that's not great either, but it's not our fault! Get a real compiler!

3am. Still writing my slides for my talk tomorrow. Silly boy.

7:30am. Still here. Slides almost done. My talk is in three hours. I'm cobbling together a 2.1pre1 release to collect all the miscellaneous little bugfixes over the last few months. It's on the fourth hour long RPM build now, and it should actually work this time. Unfortunately I've just found out that not only does SourceForge have scheduled downtime tonight so that nobody will be able to download my release, but also the uploader has been broken for the last week so I can't upload it either.

I sure picked a good day to try to make a release on SourceForge!

lkcl writes that while skating,
...a car tried to force me into a different lane ... perhaps they should check the laws...

Just curious... does Oz law recognise skates as a roadworthy vehicle? If so, I'm impressed!

Happily, no cars tried to kill me on my way in to work this morning (cycling on Sunnyvale's Lawrence Expressway, which is much like a New Zealand motorway, only with more lanes). It may be a better than average week on that statistic.

Meanwhile, in computer-land (rather than commuter-land, har har), gibreel writes:

prc-tools continues to go way too slowly, due mainly to my having to spend a lot of time doing things for which I get paid.
Er, possibly also because its maintainer hasn't been getting back to you about any of your problems. Sorry about that.
I've hacked around the binutils issue by reverting to a base code segment address of 0x1000 instead of 0x0.
Yeah -- the warning you were getting was new in binutils 2.10, which is why I wasn't getting it before. You could disable it by adding --no-check-sections to the spec file.
This will probably break other things horribly,
Yup. But it's possible that the section base arrangement will have to change like this anyway to support the debugger, and there's another nasty bug that's related too.

It's been one of those days on palm-dev-forum:


Zaitcev talked about the TiVo's "30 minutes T/S buffer" being too small. I'm not entirely sure what he means by "T/S buffer", but I'm guessing that he's talking about the way it will record up to 30 minutes of Live TV when you haven't told it to record anything in particular. In fact, you can increase this if you try hard enough.

Okay, you guessed it, I'm a proud new TiVo owner. I chose it because it runs Linux and you can do silly things like drop extra hard drives in and get a bash prompt on its serial port. One day I'm going to remember to take my Palm Pilot cradle home so I can use a terminal program on that serial port. Or I guess I could finally get around to buying a computer with a keyboard...

This personal TV / digital video recorder stuff is way cool. It took about a day for us to realise that the thing was indispensible and we should have got one months ago. I think I will end up watching less television: no more sitting there glumly surfing around thinking there must be something worth watching somewhere.

There's no way I can ever get home by 6pm when it's on, but now I can watch the BBC World News every night regardless. Bliss. I wish it had more British news though...

6 Sep 2000 (updated 6 Sep 2000 at 02:24 UTC) »
gibreel says he finally found time to do the prc-tools package for Debian. Great! It's only been about a year. :-) But if the months are flying by for you the way they are for me, it's no surprise...

Now the bad news: there's a few stupid bugs (the fp and build-prc ones in particular) that you ought to at least apply fixes for locally rather than be broken like the 2.0 upstream distribution.

Now the really bad news: there's at least one (:-( though the other guy's really cooked himself this time) new release coming along real soon now to tidy up all these little things. It's been gestating far too long already, but I hope to have a 2.1 out by the end of this month to fix up all the little problems and a few biggies.

Uh... I hope you folks can get the bug-fixed .1 one rather than the .0 one. We should talk...

Can I move to Cape Town too please?

Zack mentioned `scare quotes' in a recent checkin. "Scare quotes,", I thought, "I know what that means, but I wonder where the term came from". Google found me a truly scary definition.
friday afternoon
Oh dear. More stuff that fell through the cracks. One of them's easily fixed; the other will take a little more work.

life in the bay area
Has anyone else noticed that VTA's light rail is always a couple of minutes early in the evening and especially in the wee hours? One week I missed trains three days out of five. One of those days I set out for the 0126, 0236, and 0346 trains home and missed each one, and eventually gave up and spent the night at work. One time I mentioned the schedule to the driver, and he turned the tannoy on to say that his watch was synchronised to an atomic clock. I wish the clocks on the platform would agree with his then.

I missed the train just now (by 20 seconds; it was two minutes early by the platform clock), so I've come back to work on the other problem.

wee hours of saturday
I just went to catch the 0020 train home. Just before I got to the station at 0015 by my watch, the train went past. @%$! So I turned back. Minutes later, I remembered that sometimes they inexplicably send dark trains five minutes before the real ones. Sure enough, at the now distant station, there it was: another train.

overriding settings
So I've fixed the other problem and checked it in. I'm not 100% sure it's exactly right, but it's checked in so people can test it.

It turned out to be a really interesting problem: we have a linker sort of thing, and its behaviour is governed by a bunch of settings. These are set from their default values, from the default handling in a control file, from specific overrides in the control file, from explicit stuff on the command line, and from options on the command line. And these all have to override each over in the right order.

This would be easy if the override order was the same as the order in which the program processes them. But that's impossible: for example, you don't know the filename of the control file until after you've processed the command line options.

...I'd write about the cute solution now, but I'm sure nobody wants to read about me missing another train!

3 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!