Menu

#368 In the output tagfile, the symbol "#undef" and "#define" is the same. I think it should not be the same.

open
nobody
None
5
2015-10-22
2015-10-20
Weng Da
No

These two define : #undef UNDEF1 / #define DEFINE1
In the output tagfile the result is:
UNDEF1 ....../assert.c 30;" d file:
UNDEF1 ....../assert.c 30;" d file:
I think it is a bug, it should not be the same.

Related

Bugs: #368

Discussion

  • Masatake YAMATO

    Masatake YAMATO - 2015-10-20

    I'm not sure your expectation. Could you show the real input file?

    [yamato@x201]/tmp/ctags% cat foo.c 
    cat foo.c 
    #undef UNDEF1 / #define DEFINE1
    [yamato@x201]/tmp/ctags% ctags -o - foo.c
    ctags -o - foo.c
    ctags: Warning: Ignoring non-option in ./.ctags
    
    UNDEF1  foo.c   1;" d   file:
    
    [yamato@x201]/tmp/ctags% cat bar.c
    cat bar.c
    #undef UNDEF1
    #define DEFINE1
    [yamato@x201]/tmp/ctags% ./ctags -o - bar.c 
    ./ctags -o - bar.c 
    DEFINE1 bar.c   /^#define DEFINE1$/;"   d   file:
    UNDEF1  bar.c   /^#undef UNDEF1$/;" d   file:
    
     
    • Weng Da

      Weng Da - 2015-10-21

      It is like this:

      [yamato@x201]/tmp/ctags% cat bar.c

      cat bar.c

      undef UNDEF1

      define DEFINE1

      [yamato@x201]/tmp/ctags% ./ctags -o - bar.c

      ./ctags -o - bar.c

      DEFINE1 bar.c /^#define DEFINE1$/;" d file:

      UNDEF1 bar.c /^#undef UNDEF1$/;" d file:

      The output of “#undef” and “#define” are both “d”, I think the “#undef” and “#define” are not the same symbol.

      发件人: Masatake YAMATO [mailto:m_yamato@users.sf.net]
      发送时间: 2015年10月20日 10:59
      收件人: [ctags:bugs]
      主题: [ctags:bugs] #368 In the output tagfile, the symbol "#undef" and "#define" is the same. I think it should not be the same.

      I'm not sure your expectation. Could you show the real input file?

      [yamato@x201]/tmp/ctags% cat foo.c

      cat foo.c

      undef UNDEF1 / #define DEFINE1

      [yamato@x201]/tmp/ctags% ctags -o - foo.c

      ctags -o - foo.c

      ctags: Warning: Ignoring non-option in ./.ctags

      UNDEF1 foo.c 1;" d file:

      [yamato@x201]/tmp/ctags% cat bar.c

      cat bar.c

      undef UNDEF1

      define DEFINE1

      [yamato@x201]/tmp/ctags% ./ctags -o - bar.c

      ./ctags -o - bar.c

      DEFINE1 bar.c /^#define DEFINE1$/;" d file:

      UNDEF1 bar.c /^#undef UNDEF1$/;" d file:


      [bugs:#368]http://sourceforge.net/p/ctags/bugs/368/ In the output tagfile, the symbol "#undef" and "#define" is the same. I think it should not be the same.

      Status: open
      Group:
      Created: Tue Oct 20, 2015 02:22 AM UTC by Weng Da
      Last Updated: Tue Oct 20, 2015 02:22 AM UTC
      Owner: nobody

      These two define : #undef UNDEF1 / #define DEFINE1
      In the output tagfile the result is:
      UNDEF1 ....../assert.c 30;" d file:
      UNDEF1 ....../assert.c 30;" d file:
      I think it is a bug, it should not be the same.


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/ctags/bugs/368/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #368

  • Masatake YAMATO

    Masatake YAMATO - 2015-10-22

    I see.

    I can offset only following two choices.
    1. Throwing away undef: universal-ctags developed at https://ctags.io has --undef=no option. With it you can make ctags not generate tags for undefs. If you are not interested in tags for undef, this is useful.
    2. Exnteding ctags. By introducing a new concept "reference tag", undef can be handled well. I wrote my idea at https://github.com/universal-ctags/ctags/pull/569.

     

Log in to post a comment.