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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:44:45+00:00 2026-05-14T21:44:45+00:00

When an assert() call fails, what is the exit code used, and where is

  • 0

When an assert() call fails, what is the exit code used, and where is it documented?

  • 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-14T21:44:46+00:00Added an answer on May 14, 2026 at 9:44 pm

    The C99 (unchanged in C11) standard states that assert calls abort and the abort stuff states this about the return code:

    An implementation-defined form of the status unsuccessful termination is returned to the host environment by means of the function call raise(SIGABRT).

    It’s documented in section 7.2.1.1 (assert) and 7.20.4.1 (abort) of the C99 standard here.

    Many UNIX systems will return 128 plus the signal number (SIGABRT is signal number 6) so you may get 134. Whatever you get, it should be documented by the C implementation.

    For example, see here for gcc. Although it’s quite silent on what gets returned to the calling environment. From the specific sections here:

    Some choices are made by the library and operating system (or other environment when compiling for a freestanding environment); refer to their documentation for details.

    And here:

    The behavior of most of these points are dependent on the implementation of the C library, and are not defined by GCC itself.

    So is the glibc doco here on program termination (specifically the exit status bit). It mentions conventions but no firm rules.

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

Sidebar

Related Questions

If I use assert() and the assertion fails then assert() will call abort() ,
When Debug.Assert() method calls exist in source code and I compile in release mode,
Test below fails on last Assert() with this message: Expected: arg2 But was: arg1
Assert.Equals() never calls Equals() operator == operator != Am I missing something? I have
my_var = 3 assert('my_var' in locals()) import a_module assert('a_module' in locals()) from sys import
How would you succinctly assert the equality of Collection elements, specifically a Set in
So I see that Assert has dozens of methods that seem to do essentially
I need to assert the value of a variable in a workflow service. I've
Using nodeunit is there an assert to check for false values? Other testing frameworks
I'd like to implement an assert that prevents compilation, rather than failing at runtime,

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.