Talk:C preprocessor

From OSDev Wiki
Jump to: navigation, search

Some of the things I see here I just cannot believe. First, assert() is very well-defined in <assert.h>, and if you want to disable it, you define NDEBUG instead of undefining the macro. typeof() is a GCC extension, using which I hesitate to advertise as "good practice". complain() isn't defined anywhere, and if you replace it with printf() you'll get into trouble because the condition will be interpreted as printf() format string. The alert() function overloading is C++, not C. lnDbg() is ugly as hell, and better done with a debugger anyway. I strongly recommend cleaning up this mess. If you don't, I will, and I won't be mercyful. ;-) -- Solar 14:59, 24 June 2010 (UTC)

On second thought... was this intended to be a mock page to show why you shouldn't rely on macros (too much)? ;-) -- Solar 15:07, 24 June 2010 (UTC)
Even if it was, newbies are stupid enough not to see that. There's a lot of stuff in here that's left unexplained, lousy and inconsistent naming, stub overuse, even blocks of code without indentation. And the real tricks such as the # operator are left undescribed. As far as I am concerned, you can have my canister of nitric acid and have fun. - Combuster 15:56, 24 June 2010 (UTC)

Why exactly is there a page on the C preprocessor on an OS development wiki? Maybe I should make a tutorial on how to use GIMP to create a fancy OS splash screen... Also, some of the information is GCC-specific or just plain wrong (e.g., on the #include directive). I didn't bother fixing things because I want to hear your opinion on whether we should keep this article or not. --Love4boobies 11:29, 5 August 2010 (UTC)

I'm not really sure where the boundary is for what to put on the wiki. This article is one of those articles in the "grey zone", do we keep it or do we mark it as "not for this wiki"? You could say the same for e.g. Makefiles, I think the information is useful, but it doesn't directly apply to OSDev only, it applies to general programming (just like the C Preprocessor applies to general C programming and isn't directly related to OSDev). On one hand, it's useful to have an article like this, but if we keep this, where will it stop? What prevents people from making articles such as "The C Syntax" as well? I'm not really in favor of any choices, so I'm just stating the options. --Creature 18:59, 5 August 2010 (UTC)
One of the reasons for which I disagree with this article is that C itself has nothing to do with operating systems. People could very well write their operating systems in assembly, Pascal, Ada, or even Java (although we don't have any articles explaining managed OSes yet). However, I do agree that C is the most popular language for this purpose. I can see it is noted as one of the items in the "Required Knowledge" section. So if it is a prerequisite, why are we teaching it? This isn't a C wiki... Just my $0.02. --Love4boobies 01:57, 6 August 2010 (UTC)
Personal tools
Namespaces
Variants
Actions
Navigation
About
Toolbox