News for hackers. Stuff that matters.
Re:Firefox switching to clang-cl for Windows builds by lmm on Wednesday July 11, 2018 @05:54AM (#17505658)
> Well, you waste space, time, and energy making the compiler and linker do work that doesn't inherently need to be done.

It's repetitive, error-prone work, better to have the compiler and linker do it than rely on the programmer getting their use of the preprocessor right.

And even if the programmer gets it right, doing it via macros means every tool that you want to apply to your codebase - IDEs, profilers, coverage, instrumentation - needs to understand your macro. Are you sure they'll all get it right?

Better to write plain old standard code that every tool will work correctly with, and the worst thing that can ever happen is a slight performance penalty.

Re:Firefox switching to clang-cl for Windows builds by mehrdadn on Wednesday July 11, 2018 @06:13AM (#17505727)
Are you replying to the correct comment? Not once did I even mention macros or the preprocessor.
Re:Firefox switching to clang-cl for Windows builds by lmm on Wednesday July 11, 2018 @07:01AM (#17505949)
I misunderstood, but what you're actually advocating has all the problems I mentioned only even more so. Any tool that you want to apply to your codebase will have to understand not just a macro, but your build configuration.
Re:Firefox switching to clang-cl for Windows builds by elteto on Wednesday July 11, 2018 @10:18AM (#17507104)
How would you do it without using the preprocessor? Honest question. You could leverage the build system to do that instead but that seems even worse to me... You are effectively hoisting an implementation detail up into the build system.

Like the other commenter said, I'd rather do simple, virtual calls and then fix it using LTO.