GCC Newspaper
JUNE 15, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
ada

Ada Now Rejects Duplicate CPU/Priority Pragmas when Aspects are Present.

The Ada compiler now rejects `pragma CPU` and `pragma Priority` when they duplicate corresponding aspects already defined for a subprogram.

The Ada compiler now rejects pragma CPU and pragma Priority when they duplicate corresponding aspects that are already specified for a given subprogram. Previously, the pragmas were silently ignored, potentially leading to confusion. The change modifies sem_ch13.adb to record aspect CPU and Priority applied to a subprogram as a representation item during aspect specification analysis.

In Details

The Ada language allows setting CPU affinity and priority for subprograms using both aspects and pragmas. The semantic analysis phase (sem_ch13.adb) is responsible for processing these specifications. This commit ensures that the compiler flags an error when a pragma CPU or pragma Priority duplicates an existing aspect specification, preventing silent overrides.

For Context

In Ada, programmers can specify the CPU and priority for subprograms, influencing how the operating system schedules their execution. This commit prevents potential conflicts by ensuring that the compiler flags an error if the same CPU or priority is specified in two different ways (using aspects and pragmas). This makes sure the programmer is aware of the conflict and can resolve it correctly.

Filed Under: adacompilerpragmaaspects