Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6872653
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:57:23+00:00 2026-05-27T03:57:23+00:00

I am trying to generate TAGS tables using etags for a large software project.

  • 0

I am trying to generate TAGS tables using etags for a large software project. The TAGS file ends up having entries to non-existent files at top level instead of the existent ones in a sub-directory due to #line directives in the lex/yacc generated .c files that refer to an unqualified file name instead of a #line that includes the sub-directory containing the file.

How can I get the TAGS tables to generate with these #line directives properly resolved to existing file in sub-directory instead of being interpreted as top-level files?

I run etags like this from top level directory:

rm -f TAGS; find . \( -not -regex '.*include/.*' \)
                -a \( -name '*.h' -o -name '*.hh' -o -name '*.y' -o -name '*.l'
                   -o -name '*.cc' -o -name '*.cpp' -o -name '*.hpp' -o -name '*.c'
                   -o -name '*.inl' \)
             | xargs etags -o TAGS --append

But I have a file, act/Par.c, that contains the following lines in the middle of the generated file:

#define T_NUM 274
#define T_STRING 275

#line 5 "Par.y"

#undef actCPMeshConfigIn_yywrap
#define actCPMeshConfigIn_YYMAXDEPTH 20000

Which results in TAGS table entries of the following:

act/Par.c,1160
[...]
#define T_NUM 92,2870
#define T_STRING 93,2888

Par.y,1320
#undef actCPMeshConfigIn_yywrap20,
#define actCPMeshConfigIn_YYMAXDEPTH 22,

But the file Par.y is actually located at act/Par.y, but the #line directive is relative to the current file, yet TAGS makes it relative to the generated TAGS file.

Without changing how I build the project, how can I generate the TAGS files so that these #line directives are properly interpreted as being relative to the file they occur within? Alternatively, how can I skip these troublesome files easily?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:57:24+00:00Added an answer on May 27, 2026 at 3:57 am

    Solution is to instead run Exuberant Ctags in etgas mode and recursively. You cause exuberant ctags to run in etags mode by creating a link named etags to the exuberant ctags and it detects it was launched as etags and behaves appropriately:

    etags -R .

    Alternatively -e means etags mode:

    ctags -e -R .

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to generate tags for the C Standard Lib using Exuberant Ctags 5.8,
I'm trying to generate an XML file. I've got some tags that repeat numerically
I'm trying to generate customized xml files from a template xml file in python.
I am trying to generate a Sandcastle help file for a website. In the
I'm trying to generate code coverage reports with EMMA using tests of which some
I am trying to generate div tags dynamically depending on the number of items,
I'm trying to generate an XML output from a type in C#. I'm Using
As the title implies I'm trying to generate Facebook Open Graph meta tags dynamically,
While trying to generate classes from a xsd, i got this error: java.lang.IllegalArgumentException: Illegal
I am trying to generate a report by querying 2 databases (Sybase) in classic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.