is it possible to write a macro to achieve this?

Discussion in 'C++' started by thinktwice, Apr 15, 2008.

  1. thinktwice

    thinktwice Guest

    i want to define a macro like

    #define STRING2(x) #x
    #define STRING(x) STRING2(x)

    #define PROMPT(x) #pragma message(__FILE__ "(" STRING(__LINE__) "):"
    STRING(x)) <---- compile failed

    i want to use this macro to remind me that something need to be done
    but not done yet. is it possible to write such a macro??
     
    thinktwice, Apr 15, 2008
    #1
    1. Advertising

  2. thinktwice <> wrote:
    > i want to use this macro to remind me that something need to be done
    > but not done yet.


    Why not just use #warning?

    Given your compiler supports this directive of course.

    cu
     
    Alexander Bernauer, Apr 16, 2008
    #2
    1. Advertising

  3. Hi,

    why not just using "TODO" in comments for the related locations?
    You then can just grep for "TODO" for you consilidation / clean-up
    phase in coding.
    Also IDE like eclipse will highlight "TODOs" in their viewer with
    notepad icon or alike.

    rgds
    Frank
     
    Frank Bergemann, Apr 16, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dead RAM
    Replies:
    20
    Views:
    1,174
    John Harrison
    Jul 14, 2004
  2. D Senthil Kumar

    macro name from macro?

    D Senthil Kumar, Sep 20, 2003, in forum: C Programming
    Replies:
    1
    Views:
    607
    Jack Klein
    Sep 21, 2003
  3. sounak

    to get macro name from macro value

    sounak, Nov 22, 2005, in forum: C Programming
    Replies:
    17
    Views:
    525
    Mark McIntyre
    Nov 22, 2005
  4. Replies:
    7
    Views:
    382
    CBFalconer
    Mar 25, 2006
  5. Taras_96

    Is it possible to achieve this?

    Taras_96, Feb 16, 2009, in forum: Java
    Replies:
    22
    Views:
    824
    Mark Space
    Feb 20, 2009
Loading...

Share This Page