The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] Ifdef hell
@ 2017-01-04 14:51 David
  2017-01-04 16:13 ` ron minnich
  0 siblings, 1 reply; 2+ messages in thread
From: David @ 2017-01-04 14:51 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

From: "Doug McIlroy" <doug@cs.dartmouth.edu>
Subject:Re: [TUHS] Mac OS X is Unix

> keeping the code I work on portable between Linux and the Mac requires
> more than a bit of ‘ifdef’ hell.

| Curmudgeonly comment: I bristle at the coupling of "ifdef” and "portable".
| Ifdefs that adjust code for different systems are prima facie
| evidence of NON-portability. I'll buy "configurable" as a descriptor
| for such ifdef'ed code, but not "portable".

| <snip>

| "Ifdef hell" is a fitting image for what has to be one of
| Unix's least felicitous contributions to computing. Down
| with ifdef!
| Doug

Doug makes a very good point about ifdef hell. Though I’d claim that it isn’t even “configurable” at some level.

Several years ago I was working at Megatek, a graphics h/w vendor. We were porting the X11 suite to various new boards at the rate of about 1 a week it seemed. Needless to say the code became such a mishmash of ifdef’s that you couldn’t figure out what some functions did any longer. You just hoped and prayed that your patch worked properly on the various hardware you were targeting and didn’t break it for anyone else. You ran the unit tests, if they passed you pushed your change and ran an hid under a rock for a while until you were sure it was safe to come out again.

	David


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-04 16:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-04 14:51 [TUHS] Ifdef hell David
2017-01-04 16:13 ` ron minnich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).