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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:19:34+00:00 2026-05-19T04:19:34+00:00

What are the feature of C Programming language that break the type-safety and prohibits

  • 0

What are the feature of C Programming language that break the type-safety and prohibits practical garbage collection from being added to the language? Explain.
Firstly, I don’t understand the relationship between type-safety and garbage collection. I’d appreciate if someone can help me with that.

  • 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-19T04:19:35+00:00Added an answer on May 19, 2026 at 4:19 am

    You can do garbage collection in C. It is called conservative garbage collection. The trick is to treat any data that looks like a pointer as if it were in fact a pointer, and not reclaim any memory that is reachable through it. There are two problems: first, you cannot move data around (i.e., compaction), because of the uncertainty of whether something that looks like a pointer is in fact a pointer (so updating it to point to a new location could result in data corruption).

    The type-safety problem is that it is possible for a C programmer to store a pointer to an int, perform math on it, and then restore the pointer (as in: ptrdiff_t d = (ptrdiff_t) ptr; ptr = NULL; d += 42; /* GC here would be bad */ d -= 42;) This pointer hiding could lead a conservative garbage collector to prematurely reclaim memory that was only reachable through that pointer.

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

Sidebar

Related Questions

There are a huge feature collection in C++ programming language that supply a strict
Having recently started programming in Ruby, I noticed one small language feature that is
Is the memory model for Java a feature of the Java Programming Language or
What features could be added to a new programming language to make it more
Last night I was thining that programming languages can have a feature in which
I'm looking for a programming language that has the following features: First-class functions and
In Stroustrup's The C++ Programming Language: Special Edition (3rd Ed) , Stroustrup writes that
As developer, I am often interested in new language feature that can make your
It has been said that C# can be regarded as a functional programming language,
I've noticed that there are awvully few programming tutorials in my native language (Latvian).

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.