<<< Date Index >>>     <<< Thread Index >>>

Re: Bug in Sun studio 11



On Saturday, June 16 at 02:09 AM, quoth Vladimír Marek:
The other problem with making it static is that it prevents the compiler from doing certain kinds of optimization. That's not a performance-critical function, but...

Unmeasurable.

Of course. It's hardly a *serious* complaint on my part. :)

I'd be somewhat uncomfortable with adding goofy-looking code to work around compiler bugs---especially when the bug has been fixed in the current version of the compiler. I mean, we aren't still working around gcc 1.0 bugs, why work around SS11 bugs?

Agreed. SS12 is out one month, thought ...

Fair enough. But the underlying question is still there: what compilers are considered officially "supported", and how long are such workarounds expected to stay in the code?

Why not, if you believe that it's worth of six lines instead of one.

Well, so my thinking there (and I'm not an official mutt developer, I'm just a guy with opinions) is based on my own experience with large code bases. Code that ends up looking sloppy or with unnecessarily "inelegant" pieces is code that often confuses people and is likely to be removed later (e.g. in a kruft removal) long after the original reason it's in there has been forgotten---this is particularly true when working around bugs in compilers or libraries that most of the primary developers do not or never had access to. At that point, just for maintainability (and readability) reasons, if you still want the workaround in the code, it's a good idea to put a comment in the code explaining why it looks so strange and why it needs to stay that way. Personally, though, I prefer a similarly-sized ifdef that gives non-broken compilers the more "clean" code, so I can read it and think to myself "ah, I don't have to worry about that".

Plus, of course, nobody likes "magic code" that looks strange but can't be changed. :)

~Kyle
--
Seeing a murder on television . . . can help work off one's antagonisms. And if you haven't any antagonisms, the commercials will give you some.
                                                   -- Alfred Hitchcock

Attachment: pgpyOtk2PJnPC.pgp
Description: PGP signature