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

  • Home
  • SEARCH
  • 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 8299061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:00:56+00:00 2026-06-08T16:00:56+00:00

#define ing _GLIBCXX_DEBUG forces GCC to catch a large class of runtime errors in

  • 0

#defineing _GLIBCXX_DEBUG forces GCC to catch a large class of runtime errors in C++, such as out-of-bounds STL access, invalid iterators, etc.

Unfortunately, when the error happens, the message printed is not very helpful. I know how to print a backtrace with a function, and __FILE__ and __LINE__ with a macro myself.

Is there an easy way to convince GCC to do that, or to specify a function/macro for it to call when the kind of errors that _GLIBCXX_DEBUG catches actually occur?

  • 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-08T16:00:57+00:00Added an answer on June 8, 2026 at 4:00 pm

    I assume you mean you want messages that print the context of use in your code, rather than the filename and line number of some internal header file used by GCC.

    There appears to be a single macro in .../debug/macros.h that all the checking code uses called _GLIBCXX_DEBUG_VERIFY. You could modify it to suit your needs.

    Edit: Jonathan Wakely points out that all checks are fatal.

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

Sidebar

Related Questions

Trying to redirect users to their associated 'home' page after successful login w/out nil'ing
Defining a form in my Play! controller when the compiler spit out this weird
After defining the following : abstract class A { type T def print(p: T)
When defining a string in a class using Code First, the default for the
I have two functions for GNU bc in a Bash script. BC_CEIL=define ceil(x) {
I have the following code, which uses a Unicode string class from a library
I'm ptrace'ing a process. After fork/execl and then a wait on the child, I'm
I wanted to track some options via bitmask'ing them, and borrowed bitmask values from
been google'ing for a while how is the best way to translate with google
I know that delete ing a null pointer is a no-op: In either alternative,

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.