CRT design bug?

Feedback? Questions? Comments? All discussions on the articles and tutorials hosted or developed by us go in here.

Moderator: Moderators

CRT design bug?

Postby scorpion007 » Sat Jun 07, 2008 5:45 am

In the CRT article, you define NULL as follows:

Code: Select all
#ifdef __cplusplus
extern "C"
{
#endif

/* standard NULL declaration */
#define   NULL   0 // <- This happens unconditionally!

#ifdef __cplusplus
}
#else

/* standard NULL declaration */
#define NULL   (void*)0

#endif


If I'm not mistaken, you define NULL twice in C mode.

I would have expected it to be more like:

Code: Select all
#ifdef __cplusplus
#define NULL 0
#else
#define NULL ((void*)0)
#endif


Plain and simple. Also, no need to wrap it in extern "C" as there aren't any symbols being declared.
scorpion007
 
Posts: 7
Joined: Sun Nov 18, 2007 9:32 am

Return to Article Feedback

Who is online

Users browsing this forum: No registered users and 1 guest

cron