Thread: NULL warning message

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    9

    NULL warning message

    hi every one


    i am not able to figure out why sometimes this warning message occurs during compilation.
    can sombody tell me.

    warning C4005: 'NULL' : macro redefinition
    see previous definition of 'NULL'

  2. #2
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765

    SAY WHAT !

    I can't really figure it out either.......without seing your code.

    Post your code so I can see what you're trying to do.
    The world is waiting. I must leave you now.

  3. #3
    Registered User pinko_liberal's Avatar
    Join Date
    Oct 2001
    Posts
    284
    Do you have a line in your code like
    #define NULL ****
    NULL is alread defined in some other header like <stdio.h> causing this warning to occur

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Yup yup. Do something like this, if you want your own definition of NULL:

    #ifdef NULL
    #undef NULL

    Then you can define your own. Or:

    #ifndef NULL
    #define NULL '\0'

    Quzah.

  5. #5
    Registered User
    Join Date
    Oct 2001
    Posts
    9
    thanx guys

    now i got the idea where i am doing mistake.

  6. #6
    Registered User
    Join Date
    Oct 2001
    Posts
    9
    thanx guys

    now i got the idea where i am doing mistake.

  7. #7
    Registered User pinko_liberal's Avatar
    Join Date
    Oct 2001
    Posts
    284
    even though I would advise redifining NULL if are including stdio.h

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 07-10-2008, 03:45 PM
  2. Wierd Segmentation Faults on Global Variable
    By cbranje in forum C Programming
    Replies: 6
    Last Post: 02-19-2005, 12:25 PM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Try out my new game :) !
    By Stan100 in forum Game Programming
    Replies: 10
    Last Post: 06-05-2003, 08:10 AM
  5. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM