341708

Lots of miscellaneous poking at things today, not a whole lot of code written.

Ended up being unable to sleep last night, so made a first pass at getting a way to shutdown/poweroff from the install. Should be pretty nice for a few cases, but most people will probably not care. It could be useful if you have to change your machine to not boot from the network or remove a CD or something after a kickstart install.

gcc 3.4 rebuilds chugged along and Elliot moved a whole pile of packages. Things should be mostly complete, now we're to cleaning up the failures and getting things sane again. This'll probably take a few days to get to the majority and then I'm sure there will be some stragglers for a while. Some of my failures had clean fixes in new upstream versions, so I went ahead and bumped the versions on them. Otherwise, I had a pile of small failures.

Most of them were related to the change in gcc 3.4 to require a ; (semi-colon) in compound statements, ie

switch(foo) {
  case 1:
    /* do some stuff */
    break;
  default:
}

will no longer work. Instead, you have to have


  default:
    ;
}

Now, I'm sure there's a perfectly valid reason for this, but it's still kind of annoying. It's pretty trivial to fix, though, and is pretty zero-risk. So if you have code like this, fix it. If you find code like this, fix it and send a patch to the maintainer. There's no good reason to not take it as it won't break old compilers or anything like that.

The other thing which is causing a little bit of churn is that you can't do a cast on the lvalue of an assignment anymore. ie,

void * p;
(char *) p = strdup(“some string”);

That was a gcc extension that's been deprecated for a while, though (even if people were continuing to use it). In this case, just drop the cast. If you need to do a cast, you should do it on the value on the right hand side of the assignment as opposed to on the lvalue. Again, fix your code 🙂

2 thoughts on “341708”

  1. Standard C?

    Is the first a change in standard C or has it always been that way in standard C and gcc is just now catching up?

    As far as the second item is concerned, I’m glad I never learned that extension. It looks so wrong, it gives me the shivers. That’s not something anyone should be doing to an lvalue.

    So, how does 3.4 stack up to previous versions? How’s it do with C++? (i.e. has the ABI stabilized yet so C++ programs don’t have to be recompiled again…?)

  2. Re: Standard C?

    The first is what the standard has always said, but most compilers were fairly relaxed in their interpretation and thus it worked. *shrug* I don’t care much aside from the annoyance factor of having had to fix a few things. It’s similar to how I have to use a ‘pass’ statement in some cases with python.

    As far as 3.4 stacking up… it’s a bit better performance-wise and again lots better standards-wise. Unfortunately, the “lots better standards wise” translates into yet another ABI change. This one’s pretty minor, though. If you’re not using libstdc++, then you’re probably set for not recompiling although it would be recommended. libstdc++ had a soname bump, though, so things depending on it will definitely need a rebuild. I think I’ve pretty much given up hope on this ever not being the case for c++ :/

Comments are closed.