There is no need to say "with P;" in package P.Q. This patch adds a warning for that case. We also remove with clauses in our own code that trigger the warning. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch10.adb (Check_Redundant_Withs): Add a warning if a library unit with's its own ancestor. Note that this warning is not triggered for something like "with P.R;" in P.Q, because there the "with P;" is considered implicit. * fname-sf.adb, libgnarl/s-stusta.adb, libgnarl/s-tasdeb.ads, libgnat/a-calfor.adb, libgnat/a-tiboio.adb, libgnat/a-wwboio.adb, libgnat/a-zzboio.adb, libgnat/i-cobol.adb, libgnat/s-bitops.adb, libgnat/s-bitops.ads, libgnat/s-direio.adb, libgnat/s-dwalin.adb, libgnat/s-geveop.adb, libgnat/s-mmosin__unix.adb, libgnat/s-os_lib.adb, libgnat/s-os_lib.ads, libgnat/s-pooglo.ads, libgnat/s-secsta.adb, libgnat/s-shasto.adb, libgnat/s-stausa.ads, libgnat/s-stratt.ads, libgnat/s-ststop.adb: Remove with of parent. * sinfo.ads: Minor comment fix.