[Ada] Suppress warnings on unreferenced parameters of dispatching ops

Pierre-Marie de Rodat derodat@adacore.com
Mon Aug 19 08:39:00 GMT 2019


If the -gnatwf switch is used to activate warnings on unreferenced
formal parameters, the warning is no longer given if the subprogram is
dispatching, because such warnings tend to be noise. It is quite common
to have a parameter that is necessary just because the subprogram is
overriding, or just because we need a controlling parameter for the
dispatch.

Tested on x86_64-pc-linux-gnu, committed on trunk

2019-08-19  Bob Duff  <duff@adacore.com>

gcc/ada/

	* sem_warn.adb (Warn_On_Unreferenced_Entity): Suppress warning
	on formal parameters of dispatching operations.

gcc/testsuite/

	* gnat.dg/warn29.adb, gnat.dg/warn29.ads: New testcase.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 2171 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190819/119979a6/attachment.bin>


More information about the Gcc-patches mailing list