Talk:C preprocessor: Difference between revisions

From OSDev.wiki
Latest comment: 14 years ago by Combuster
Jump to navigation Jump to search
Content added Content deleted
No edit summary
(Re: validity)
Line 1: Line 1:
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. ;-) -- [[User:Solar|Solar]] 14:59, 24 June 2010 (UTC)
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. ;-) -- [[User:Solar|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)? ;-) -- [[User:Solar|Solar]] 15:07, 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)? ;-) -- [[User:Solar|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. - [[User:Combuster|Combuster]] 15:56, 24 June 2010 (UTC)

Revision as of 15:56, 24 June 2010

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)Reply[reply]

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)Reply[reply]
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)Reply[reply]