beware of dead string constants
Quoted 3 lines · In article <[email protected]> you wrote:
This is mostly a heads-up to say that in this regard gcc is not ready for prime time, so we really can't get away with using
if()as an ifdef yet, at least not without penalty.
Humm.. whats the Advantage of this?
Greetings
Bernd
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
Quoted 7 lines · Bernd Eckenfels
Quoted 3 lines · In article <[email protected]> you wrote:
This is mostly a heads-up to say that in this regard gcc is not ready for prime time, so we really can't get away with using
if()as an ifdef yet, at least not without penalty.Humm.. whats the Advantage of this?
Advantage of what?
If you mean preferring 'if ()' over 'ifdef'... Linus. :) And I agree with him: code looks -much- more clean without ifdefs. And the compiler should be smart enough to completely eliminate code inside an 'if (0)' code block.
Jeff
Signature · 7 lines
Jeff Garzik | Building 1024 | The chief enemy of creativity is "good" sense MandrakeSoft | -- Picasso - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] Please read the FAQ at http://www.tux.org/lkml/
[Jeff Garzik]
Quoted 4 lines
If you mean preferring 'if ()' over 'ifdef'... Linus. :) And I agree with him: code looks -much- more clean without ifdefs. And the compiler should be smart enough to completely eliminate code inside an 'if (0)' code block.
Plus the advantage/disadvantage of making the compiler parse almost everything, which should eliminate syntax errors, variable name misspellings, etc in little-used config options. The disadvantage is that compilation speed goes down.
Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
On Thu, Nov 23, 2000 at 06:39:25PM -0500, Jeff Garzik wrote:
Advantage of what?
If you mean preferring 'if ()' over 'ifdef'... Linus. :) And I agree with him: code looks -much- more clean without ifdefs. And the compiler should be smart enough to completely eliminate code inside an 'if (0)' code block.
Not only that; we should move to code where the compiler engine can sanitize the code; the preprocessor alternative is obviously more limited here.
The same can also be said for some of the many macro's that are #defined; some would surely be better as inline functions is we could ensure they would always be in-lined.
--cw
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/