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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:16:55+00:00 2026-06-01T19:16:55+00:00

I found this in a multi-threaded c application. The authors commented that it’s used

  • 0

I found this in a multi-threaded c application. The authors commented that it’s used to make a thread crash in a custom assert function. GCC is fine with it, but clang issues the following warning:

note: consider using __builtin_trap() or qualifying pointer with 'volatile'

and also issues one of those, for each usage of the assert function:

warning: indirection of non-volatile null pointer will be deleted, not trap

What is going on here? Is __builtin_trap specific to clang? Should I use it?

  • 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-01T19:16:57+00:00Added an answer on June 1, 2026 at 7:16 pm

    Writing to NULL address is not guaranteed to crash your program reliably, so GCC introduced __builtin_trap for that.

    It looks like clang decided to go further, and eliminate such writes altogether, almost forcing you into using __builtin_trap. Their other option of casting NULL to volatile pointer does not look attractive compared to __builtin_trap, because it’s “merely” an undefined behavior.

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

Sidebar

Related Questions

I was debugging a multi-threaded application and found the internal structure of CRITICAL_SECTION .
I'm working on a multi-threaded C# Windows application that makes frequent calls into a
Initially when I learned how to write a multi view application I found this
Initially when I learned how to write a multi view application I found this
I am working on a multi-threaded application. This application started out as a single
We had multi-threaded application. Each thread has to invoke with CoIntialize when it is
I'm currently working on a multi-threaded application that would be deployed on arm and
Found this question that explained a way to communicate between layers. However there is
I found this question that is discussing what I would like to do, but
I found this example and used it How do you resize a Bitmap under

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.