I was reading Chapter 13 in the Barnes text on Ada 2022 and came across the No_Dependence restriction.
OK, why? I’m sure there’s a reason, but all I could think of is: package A depends on package B, for some reason A is compatible with package C, and you want to make sure that someone working on B never, ever, ever introduces a dependency on C? (or things along those lines)
Pragma Restrictions provides a way for a project (or an individual developer) to impose restrictions on their own source code, and have them enforced by the compiler. So if in your project you want to be sure there is no use of a particular Ada library unit, say “Unchecked_Deallocation” or “Task_Attributes” for example, you can impose the No_Dependence restriction on your project specifying the library unit, and then the compiler and linker will work together to make sure you never build a program with such a dependence.