> _Sometimes_ you can just append C files together and they happen to > work. But not always. A simple case where it fails would be when you > have a static variable with the same name in two different files. Afaik in the kernel global static variables are not appreciated much. In any case file scope can be easily added by s/// to its name in text compile stage. There are much more problems with conditional includes and other source configuration crutches. > The compiler will do the right thing there., while naïve concatenation > of C files will not. That was an example, of course there must be pre-cc text processing stage. > Of course, it's _possible_ to have external text processing cope with > this case somehow -- you'd probably feed it through the preprocessor, > then look at the output of the preprocessor and make the variable names > unique, perhaps? Even before cpp. But twisted includes/ifdef's cannot be handled without it. > And then move on to the next case which is already handled in gcc... To gain size reduction, some register-wide static variables (ints), which are usually for some state-handling, can be glued together, if whole picture permits: all flags fit in limited bit range, needed shift is added textually. Again developer doing clear/documented semantics, text-based transformations is needed. Can it be done by GCC optimizing stages? (However Rusty may try to do that with cpp :) > But really, I'd rather just leave it to the compiler. And it's not > because I have some masochistic fascination with makefiles :) -- sed 'sed && sh + olecom = love' << '' -o--=O`C #oo'L O <___=E M -- To unsubscribe from this list: send the line "unsubscribe linux-embedded" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html