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 7869933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:28:08+00:00 2026-06-03T01:28:08+00:00

I use autotools to manage my CPP project. When compile my code, gcc has

  • 0

I use autotools to manage my CPP project. When compile my code, gcc has these flags: -Wall -Werror

So, when there is an warning in my code, gcc will treat it as error, the compile will be interrupted.

My project also includes antlr3, which generate several files. The generated files contain several warnings, which interrupt compiling.

error: unused variable ‘index21_49’
in CongerCQLLexer.c, line 20589, column 24
20587>                 ANTLR3_UINT32 LA21_49;
20588> 
20589>                 ANTLR3_MARKER index21_49;
20590> 
20591> 

error: unused variable ‘index21_131’
in CongerCQLLexer.c, line 20622, column 24
20620>                 ANTLR3_UINT32 LA21_131;
20621> 
20622>                 ANTLR3_MARKER index21_131;
20623> 
20624> 

I want to know how to disable warnings for the generated files?
thank you.

  • 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-06-03T01:28:09+00:00Added an answer on June 3, 2026 at 1:28 am

    The answer depends greatly on how you are getting -Wall -Werror into the build. If you are assigning CFLAGS directly in configure.ac, the solution is to stop doing that. CFLAGS is a user variable and should only be assigned by the user. If you are setting them in AM_CFLAGS, you can instead add them only to specific files via foo_CFLAGS. However, assiging -Wall -Werror to CFLAGS is a bad idea for several reasons, one of which is that not all compilers accept those flags. Do you want the build to die with ‘-Werror — unknown option’? Although many (most?) compilers do accept -Wall -Werror, the point is that you do not know what compiler your user is using, and you do not know if -Werror is useful or even accepted, and you do not know if the user wants those flags set. Let the user decide.

    Automake does not provide much granularity in terms of defining flags for particular translation units at configure time, but it would be fairly straightforward to add a variable that the user can assign that would be used for all non-built sources, and another for built sources. Instead of assigning CFLAGS, the user could assign BUILT_CFLAGS, and you could add those to foo_CFLAGS for appropriate values of foo. Normally the solution for this is to do nothing and let the user make the necessary adjustments (ie, the user will build with -Werror in CFLAGS, see the build fail, and then rebuild without -Werror.)

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

Sidebar

Related Questions

I am trying to run an autotools configure script for the bson-cpp project, and
Is there a way with autotools (automake) to transform this big line gcc -DHAVE_CONFIG_H
I see this often in the build scripts of projects that use autotools (autoconf,
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move
I need to set -Wall -Werror as CPPFLAGS for all the source files in
I've got a Subversion project that uses Gnu Autotools (i.e., automake, autoconf, and libtool)
I have an existing C++ source code that is built using autotools and i
Use case example: Client A comes to request sales information, enters their zip code
Use Eclipse Classic with ADT plugin. Tried to make project from existing example of
Summary : I have a project using GNU Autotools. I have a pot file.

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.