On Jul 23, 2012, at 11:21, Geert Bosch wrote: > On Jul 23, 2012, at 10:45, Arnaud Charlet wrote: >> No, as we agreed and discussed, the flag does NOT have to be defined for all >> versions of system.ads, so this is a bug that needs to be fixed (precisely >> for the issue raised here: we don't want unknown or new ports to be broken >> by default). > > Having a default can't work, as s-atopri.adb needs access to the flag. > Only the front end itself can use a default, not the run time.
While currently the flag is needed, I agree with you that this is undesirable. The only way to avoid this is to have a type attribute, such as T'Atomic_Always_Lock_Free that is statically True if T is known to be supported for atomic operations. This would be similar to the atomic built-in __atomic_always_lock_free function, but initially based on the value of the system constant (as well as size/alignment of the type). Eventually, we should be able to query this directly from the back end. Regardless, the situation as of now is that system.ads must define the flag, so right now Iain's patch is correct and fixes a build failure. As soon as the attribute is implemented, we can remove the system flags on systems where it is set to False. -Geert