Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Im told Ada does all sorts of static type checking, but can you get the same effect using a tool like “lint” with C?

0
Posted

Im told Ada does all sorts of static type checking, but can you get the same effect using a tool like “lint” with C?

0

No, here are a few reasons why (this list is by no means complete): (Submitted by Norm Cohen) • Running both Lint and a C compiler requires the program text to be parsed and semantically analyzed twice. The results of an Ada compiler’s parse and semantic analysis are used directly in performing consistency checks. • The rules of Ada provide the opportunity for stronger consistency checks than are possible with C. For example, an Ada programmer can declare distinct integer types to represent distinct abstractions. An Ada compiler will catch an inadvertent intermixing of these two types, but there is no way a corresponding distinction can be made in C, so there is no way for Lint to perform a corresponding check. Similarly, in C, a pointer to an object of type T is indistinguishable from an array of objects of type T. • The rules of the Ada language ensure that the program text provides information allowing PRECISE consistency checks. For example, the expression in an Ada case statement

0

No, here are a few reasons why (this list is by no means complete): (Submitted by Norm Cohen)

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.