diff mbox series

testsuite: Prepare for -std=gnu23 default

Message ID 88b3f6b9-794b-8ad6-6a8c-6019926428f0@redhat.com
State New
Headers show
Series testsuite: Prepare for -std=gnu23 default | expand

Commit Message

Joseph Myers Oct. 16, 2024, 11:01 a.m. UTC
Now that C23 support is essentially feature-complete, I'd like to
switch the default language version for C compilation to -std=gnu23.

This requires updating a large number of testcases that fail with the
new language version if left unchanged.  In this patch, update most of
the tests for which there is a safe change that works both before and
after the update to default language version - typically adding the
option -std=gnu17 or -Wno-old-style-definition to the tests.  (There
are also a few tests where I'd like to investigate further why they
fail with -std=gnu23, or where I think such failures show an actual
bug to fix before changing the default language version, or where it
seems more appropriate to make a testcase change that would result in
failures in the absence of the language version change rather than
just adding an option that does nothing with the gnu17 default.)

The libffi test fixes have also been submitted upstream:
<https://github.com/libffi/libffi/pull/861>.

Most of the failures requiring such changes are for one of two
reasons:

* Unprototyped function declarations with () (meaning the same as
  (void) in C23 mode) for a function then called with arguments.

* Old-style function definitions, which warn by default in C23 mode,
  so resulting in test failures for the unexpected warnings.

Other reasons for failures include:

* Tests with their own definitions of bool, true and false.

* Tests of diagnostics (often with -pedantic) in cases where C23 has
  changed semantics, such as:

  - tag compatibility for structs;
  - enum values out of range of int;
  - handing of qualified array types;
  - decimal floating types formerly needing -pedantic diagnostics, but
    being standard in C23.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.  OK to commit?

gcc/testsuite/
	* c-c++-common/Wcast-function-type.c: Add -std=gnu17 for C.
	* c-c++-common/Wformat-pr84258.c: Add -std=gnu17 for C.
	* c-c++-common/Wvarargs.c: Add -std=gnu17 for C.
	* c-c++-common/analyzer/data-model-12.c: Add -std=gnu17 for C.
	* c-c++-common/builtins.c: Add -std=gnu17 for C.
	* c-c++-common/pointer-to-fn1.c: Add -std=gnu17 for C.
	* c-c++-common/pragma-diag-17.c: Add -std=gnu17 for C.
	* c-c++-common/sizeof-array-argument.c: Add
	-Wno-old-style-definition for C.
	* g++.dg/lto/pr54625-1_0.c: Add -std=gnu17.
	* g++.dg/lto/pr54625-2_0.c: Add -std=gnu17.
	* gcc.c-torture/compile/20040214-2.c: Add -std=gnu17.
	* gcc.c-torture/compile/921011-2.c: Add -std=gnu17.
	* gcc.c-torture/compile/931102-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/990801-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/nested-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr100241-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr106101.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr113616.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr47967.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr51694.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr71109.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr83051-2.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr89663-1.c: Add -std=gnu17
	-Wno-builtin-declaration-mismatch.
	* gcc.c-torture/compile/pr94238.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr96796.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr97576.c: Add -std=gnu17.
	* gcc.c-torture/compile/udivmod4.c: Add -std=gnu17.
	* gcc.c-torture/execute/20010605-2.c: Add -std=gnu17.
	* gcc.c-torture/execute/20020404-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/20030714-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/20051012-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/20190820-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/920612-1.c: Add -Wno-old-style-definition.
	* gcc.c-torture/execute/930608-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/comp-goto-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/ieee/fp-cmp-1.x: Add -std=gnu17.
	* gcc.c-torture/execute/ieee/fp-cmp-2.x: Add -std=gnu17.
	* gcc.c-torture/execute/ieee/fp-cmp-3.x: Add -std=gnu17.
	* gcc.c-torture/execute/ieee/fp-cmp-4.x: New file.
	* gcc.c-torture/execute/ieee/fp-cmp-4f.x: New file.
	* gcc.c-torture/execute/ieee/fp-cmp-4l.x: New file.
	* gcc.c-torture/execute/loop-9.c: Add -std=gnu17.
	* gcc.c-torture/execute/pr103209.c: Add -std=gnu17.
	* gcc.c-torture/execute/pr28289.c: Add -std=gnu17.
	* gcc.c-torture/execute/pr34982.c: Add -std=gnu17.
	* gcc.c-torture/execute/pr67037.c: Add -std=gnu17.
	* gcc.c-torture/execute/va-arg-2.c: Add -std=gnu17.
	* gcc.dg/20010202-1.c: Add -std=gnu17.
	* gcc.dg/20020430-1.c: Add -std=gnu17.
	* gcc.dg/20031218-3.c: Add -std=gnu17.
	* gcc.dg/20040127-1.c: Add -std=gnu17.
	* gcc.dg/20041014-1.c: Add -Wno-old-style-definition.
	* gcc.dg/20041122-1.c: Add -std=gnu17.
	* gcc.dg/20050309-1.c: Add -std=gnu17.
	* gcc.dg/20061026.c: Add -std=gnu17.
	* gcc.dg/20101010-1.c: Add -std=gnu17.
	* gcc.dg/Warray-parameter-10.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch-2.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch-3.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch-4.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch-5.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch.c: Add -std=gnu17.
	* gcc.dg/Wcxx-compat-2.c: Add -std=gnu17.
	* gcc.dg/Wdouble-promotion.c: Add -std=gnu17.
	* gcc.dg/Wfree-nonheap-object-7.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-1.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-1a.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-2.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-3.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-4.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-4a.c: Add -std=gnu17.
	* gcc.dg/Wincompatible-pointer-types-1.c: Add -std=gnu17.
	* gcc.dg/Wrestrict-19.c: Add -std=gnu17.
	* gcc.dg/Wrestrict-4.c: Add -std=gnu17.
	* gcc.dg/Wrestrict-5.c: Add -std=gnu17.
	* gcc.dg/Wstrict-overflow-20.c: Add -std=gnu17.
	* gcc.dg/Wstringop-overflow-13.c: Add -std=gnu17.
	* gcc.dg/analyzer/doom-d_main-IdentifyVersion.c: Add -std=gnu17.
	* gcc.dg/analyzer/doom-s_sound-pr108867.c: Add -std=gnu17.
	* gcc.dg/analyzer/pr93032-mztools-signed-char.c: Add
	-Wno-old-style-definition.
	* gcc.dg/analyzer/pr93032-mztools-unsigned-char.c: Add
	-Wno-old-style-definition.
	* gcc.dg/analyzer/pr93355-localealias.c: Add
	-Wno-old-style-definition.
	* gcc.dg/analyzer/pr93375.c: Add -std=gnu17.
	* gcc.dg/analyzer/pr94688.c: Add -std=gnu17.
	* gcc.dg/analyzer/sensitive-1.c: Add -std=gnu17.
	* gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c:
	Add -std=gnu17.
	* gcc.dg/analyzer/torture/pr104863.c: Add -std=gnu17.
	* gcc.dg/analyzer/torture/pr93379.c: Add -std=gnu17.
	* gcc.dg/array-quals-2.c: Add -std=gnu17.
	* gcc.dg/attr-invalid.c: Add -Wno-old-style-definition.
	* gcc.dg/auto-init-uninit-A.c: Add -Wno-old-style-definition.
	* gcc.dg/builtin-choose-expr.c: Declare exit with (int) prototype.
	* gcc.dg/builtin-tgmath-err-1.c: Add -std=gnu17.
	* gcc.dg/builtins-30.c: Add -std=gnu17.
	* gcc.dg/cast-function-1.c: Add -std=gnu17.
	* gcc.dg/cleanup-1.c: Add -std=gnu17.
	* gcc.dg/compat/struct-complex-1_x.c: Add -std=gnu17.
	* gcc.dg/compat/struct-complex-2_x.c: Add -std=gnu17.
	* gcc.dg/compat/union-m128-1_x.c: Add -std=gnu17.
	* gcc.dg/debug/dwarf2/pr66482.c: Add -std=gnu17.
	* gcc.dg/dfp/composite-type-2.c: Add -std=gnu17.
	* gcc.dg/dfp/composite-type.c: Add -std=gnu17.
	* gcc.dg/dfp/keywords-pedantic.c: Add -std=gnu17.
	* gcc.dg/dremf-type-compat-1.c: Add -std=gnu17.
	* gcc.dg/dremf-type-compat-2.c: Add -std=gnu17.
	* gcc.dg/dremf-type-compat-3.c: Add -std=gnu17.
	* gcc.dg/dremf-type-compat-4.c: Add -std=gnu17.
	* gcc.dg/enum-compat-1.c: Add -std=gnu17.
	* gcc.dg/enum-compat-2.c: Add -std=gnu17.
	* gcc.dg/floatn-errs.c: Add -std=gnu17.
	* gcc.dg/fltconst-pedantic-dfp.c: Add -std=gnu17.
	* gcc.dg/format/proto.c: Add -std=gnu17.
	* gcc.dg/format/sentinel-1.c: Add -std=gnu17.
	* gcc.dg/gomp/declare-simd-1.c: Add -Wno-old-style-definition.
	* gcc.dg/ifelse-1.c: Add -Wno-old-style-definition.
	* gcc.dg/inline-33.c: Add -std=gnu17.
	* gcc.dg/ipa/inline-5.c: Add -std=gnu17.
	* gcc.dg/ipa/ipa-sra-21.c: Add -std=gnu17.
	* gcc.dg/ipa/pr102714.c: Add -std=gnu17.
	* gcc.dg/ipa/pr104813.c: Add -std=gnu17.
	* gcc.dg/ipa/pr108679.c: Add -std=gnu17.
	* gcc.dg/ipa/pr42706.c: Add -std=gnu17.
	* gcc.dg/ipa/pr88214.c: Add -Wno-old-style-definition.
	* gcc.dg/ipa/pr91853.c: Add -Wno-old-style-definition.
	* gcc.dg/ipa/pr93763.c: Add -std=gnu17.
	* gcc.dg/ipa/pr96482-2.c: Add -std=gnu17.
	* gcc.dg/lto/20091013-1_2.c: Add -std=gnu17.
	* gcc.dg/lto/20091015-1_2.c: Add -std=gnu17.
	* gcc.dg/lto/pr113197_1.c: Add -std=gnu17.
	* gcc.dg/lto/pr54702_1.c: Add -std=gnu17.
	* gcc.dg/lto/pr99849_0.c: Add -std=gnu17.
	* gcc.dg/noncompile/920923-1.c: Add -std=gnu17.
	* gcc.dg/noncompile/old-style-parm-1.c: Add
	-Wno-old-style-definition.
	* gcc.dg/noncompile/old-style-parm-3.c: Add
	-Wno-old-style-definition.
	* gcc.dg/noncompile/pr30552-2.c: Add -Wno-old-style-definition.
	* gcc.dg/noncompile/pr30552-3.c: Add -std=gnu17.
	* gcc.dg/noncompile/pr71265.c: Add -Wno-old-style-definition.
	* gcc.dg/noncompile/pr79758-2.c: Add -Wno-old-style-definition.
	* gcc.dg/noncompile/pr79758.c: Add -Wno-old-style-definition.
	* gcc.dg/noncompile/va-arg-1.c: Add -std=gnu17.
	* gcc.dg/old-style-prom-1.c: Add -std=gnu17.
	* gcc.dg/old-style-prom-2.c: Add -std=gnu17.
	* gcc.dg/old-style-prom-3.c: Add -std=gnu17.
	* gcc.dg/old-style-then-proto-1.c: Add -std=gnu17.
	* gcc.dg/parm-incomplete-1.c: Add -std=gnu17.
	* gcc.dg/parm-mismatch-1.c: Add -std=gnu17.
	* gcc.dg/permerror-default.c: Add -std=gnu17.
	* gcc.dg/permerror-fpermissive-nowarning.c: Add -std=gnu17.
	* gcc.dg/permerror-fpermissive.c: Add -std=gnu17.
	* gcc.dg/permerror-noerror.c: Add -std=gnu17.
	* gcc.dg/permerror-nowarning.c: Add -std=gnu17.
	* gcc.dg/permerror-pedantic.c: Add -std=gnu17.
	* gcc.dg/plugin/infoleak-net-ethtool-ioctl.c: Add -std=gnu17.
	* gcc.dg/pointer-array-quals-1.c: Add -std=gnu17.
	* gcc.dg/pointer-array-quals-2.c: Add -std=gnu17.
	* gcc.dg/pr100791.c: Add -std=gnu17.
	* gcc.dg/pr100843.c: Add -std=gnu17.
	* gcc.dg/pr102273.c: Add -std=gnu17.
	* gcc.dg/pr102385.c: Add -std=gnu17.
	* gcc.dg/pr103222.c: Add -std=gnu17.
	* gcc.dg/pr105140.c: Add -std=gnu17.
	* gcc.dg/pr105150.c: Add -std=gnu17.
	* gcc.dg/pr105250.c: Add -std=gnu17.
	* gcc.dg/pr105972.c: Add -Wno-old-style-definition.
	* gcc.dg/pr111039.c: Add -std=gnu17.
	* gcc.dg/pr111407.c: Add -std=gnu17.
	* gcc.dg/pr111922.c: Add -Wno-old-style-definition.
	* gcc.dg/pr15236.c: Add -std=gnu17.
	* gcc.dg/pr17188-1.c: Add -std=gnu17.
	* gcc.dg/pr20368-1.c: Add -std=gnu17.
	* gcc.dg/pr20368-2.c: Add -std=gnu17.
	* gcc.dg/pr20368-3.c: Add -std=gnu17.
	* gcc.dg/pr27331.c: Add -Wno-old-style-definition.
	* gcc.dg/pr27861-1.c: Add -std=gnu17.
	* gcc.dg/pr28121.c: Add -std=gnu17.
	* gcc.dg/pr28243.c: Add -std=gnu17.
	* gcc.dg/pr28888.c: Add -std=gnu17.
	* gcc.dg/pr29254.c: Add -std=gnu17.
	* gcc.dg/pr34457-1.c: Add -std=gnu17.
	* gcc.dg/pr36015.c: Add -std=gnu17.
	* gcc.dg/pr38245-3.c: Add -std=gnu17.
	* gcc.dg/pr38245-4.c: Add -std=gnu17.
	* gcc.dg/pr41241.c: Add -std=gnu17.
	* gcc.dg/pr43058.c: Add -std=gnu17.
	* gcc.dg/pr44539.c: Add -std=gnu17.
	* gcc.dg/pr45055.c: Add -std=gnu17.
	* gcc.dg/pr50908.c: Add -Wno-old-style-definition.
	* gcc.dg/pr60647-1.c: Add -Wno-old-style-definition.
	* gcc.dg/pr63762.c: Add -std=gnu17.
	* gcc.dg/pr63804.c: Add -std=gnu17.
	* gcc.dg/pr68306-3.c: Add -std=gnu17.
	* gcc.dg/pr68533.c: Add -std=gnu17.
	* gcc.dg/pr69156.c: Add -std=gnu17.
	* gcc.dg/pr7356-2.c: Add -Wno-old-style-definition.
	* gcc.dg/pr79983.c: Add -std=gnu17.
	* gcc.dg/pr83463.c: Add -std=gnu17.
	* gcc.dg/pr87347.c: Add -std=gnu17.
	* gcc.dg/pr89521-1.c: Add -std=gnu17.
	* gcc.dg/pr89521-2.c: Add -std=gnu17.
	* gcc.dg/pr90648.c: Add -std=gnu17.
	* gcc.dg/pr93573-1.c: Add -std=gnu17.
	* gcc.dg/pr94167.c: Add -std=gnu17.
	* gcc.dg/pr94705.c: Add -std=gnu17.
	* gcc.dg/pr95118.c: Add -std=gnu17.
	* gcc.dg/pr96335.c: Add -std=gnu17.
	* gcc.dg/pr97830.c: Add -std=gnu17.
	* gcc.dg/pr97882.c: Add -std=gnu17.
	* gcc.dg/pr99122-2.c: Add -std=gnu17.
	* gcc.dg/pr99122-3.c: Add -std=gnu17.
	* gcc.dg/qual-component-1.c: Add -std=gnu17.
	* gcc.dg/sibcall-6.c: Add -Wno-old-style-definition.
	* gcc.dg/sms-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tm/20091221.c: Add -std=gnu17.
	* gcc.dg/torture/bfloat16-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float128-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float128x-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float16-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float32-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float32x-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float64-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float64x-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr102762.c: Add -std=gnu17.
	* gcc.dg/torture/pr103987.c: Add -std=gnu17.
	* gcc.dg/torture/pr104825.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr105166.c: Add -std=gnu17.
	* gcc.dg/torture/pr105185.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr109652.c: Add -std=gnu17.
	* gcc.dg/torture/pr112444.c: Add -std=gnu17.
	* gcc.dg/torture/pr113895-3.c: Add -std=gnu17.
	* gcc.dg/torture/pr24626-2.c: Add -std=gnu17.
	* gcc.dg/torture/pr25183.c: Add -std=gnu17.
	* gcc.dg/torture/pr38948.c: Add -std=gnu17.
	* gcc.dg/torture/pr44807.c: Add -std=gnu17.
	* gcc.dg/torture/pr47281.c: Add -std=gnu17.
	* gcc.dg/torture/pr47958-1.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr48063.c: Add -std=gnu17.
	* gcc.dg/torture/pr57036-1.c: Add -std=gnu17.
	* gcc.dg/torture/pr57330.c: Add -std=gnu17.
	* gcc.dg/torture/pr57584.c: Add -std=gnu17.
	* gcc.dg/torture/pr67741.c: Add -std=gnu17.
	* gcc.dg/torture/pr68104.c: Add -std=gnu17.
	* gcc.dg/torture/pr69242.c: Add -std=gnu17.
	* gcc.dg/torture/pr70457.c: Add -std=gnu17.
	* gcc.dg/torture/pr70985.c: Add -std=gnu17.
	* gcc.dg/torture/pr71606.c: Add -std=gnu17.
	* gcc.dg/torture/pr71816.c: Add -std=gnu17.
	* gcc.dg/torture/pr77286.c: Add -std=gnu17.
	* gcc.dg/torture/pr77646.c: Add -std=gnu17.
	* gcc.dg/torture/pr77677-2.c: Add -std=gnu17.
	* gcc.dg/torture/pr78365.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr79732.c: Add -std=gnu17.
	* gcc.dg/torture/pr80612.c: Add -std=gnu17.
	* gcc.dg/torture/pr80764.c: Add -std=gnu17.
	* gcc.dg/torture/pr80842.c: Add -std=gnu17.
	* gcc.dg/torture/pr81900.c: Add -std=gnu17.
	* gcc.dg/torture/pr82276.c: Add -std=gnu17.
	* gcc.dg/torture/pr84803.c: Add -std=gnu17.
	* gcc.dg/torture/pr93124.c: Add -std=gnu17.
	* gcc.dg/torture/pr97330-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-prof/comp-goto-1.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/20030703-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030708-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030709-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030709-3.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030710-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030711-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030711-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030711-3.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030714-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030714-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030728-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-10.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-11.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-3.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-6.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-7.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030814-4.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030814-5.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030814-6.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030918-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20040514-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/loadpre7.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/pr111003.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr115128.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr115191.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr24840.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr69666.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr70232.c: Add -std=gnu17.
	* gcc.dg/ubsan/pr79757-1.c: Add -Wno-old-style-definition.
	* gcc.dg/ubsan/pr79757-2.c: Add -Wno-old-style-definition.
	* gcc.dg/ubsan/pr79757-3.c: Add -Wno-old-style-definition.
	* gcc.dg/ubsan/pr81223.c: Add -std=gnu17.
	* gcc.dg/uninit-10-O0.c: Add -Wno-old-style-definition.
	* gcc.dg/uninit-10.c: Add -Wno-old-style-definition.
	* gcc.dg/uninit-32.c: Add -std=gnu17.
	* gcc.dg/uninit-41.c: Add -std=gnu17.
	* gcc.dg/uninit-A-O0.c: Add -Wno-old-style-definition.
	* gcc.dg/uninit-A.c: Add -Wno-old-style-definition.
	* gcc.dg/unused-1.c: Add -Wno-old-style-definition.
	* gcc.dg/vect/bb-slp-pr114249.c: Add -std=gnu17.
	* gcc.dg/vect/bb-slp-pr97486.c: Add -std=gnu17.
	* gcc.dg/vect/bb-slp-subgroups-1.c: Add -std=gnu17.
	* gcc.dg/vect/bb-slp-subgroups-2.c: Add -std=gnu17.
	* gcc.dg/vect/bb-slp-subgroups-3.c: Add -std=gnu17.
	* gcc.dg/vect/vect-early-break_111-pr113731.c: Add -std=gnu17.
	* gcc.dg/vect/vect-early-break_122-pr114239.c: Add -std=gnu17.
	* gcc.dg/vect/vect-multi-peel-gaps.c: Add -std=gnu17.
	* gcc.dg/vla-stexp-2.c: Add -std=gnu17.
	* gcc.dg/warn-1.c: Add -Wno-old-style-definition.
	* gcc.dg/winline-10.c: Add -Wno-old-style-definition.
	* gcc.dg/wtr-label-1.c: Add -Wno-old-style-definition.
	* gcc.dg/wtr-switch-1.c: Add -Wno-old-style-definition.
	* gcc.target/i386/excess-precision-3.c: Add
	-Wno-old-style-definition.
	* gcc.target/i386/fma4-256-nmsubXX.c: Add -std=gnu17.
	* gcc.target/i386/fma4-nmsubXX.c: Add -std=gnu17.
	* gcc.target/i386/nop-mcount.c: Add -Wno-old-style-definition.
	* gcc.target/i386/pr102627.c: Add -std=gnu17.
	* gcc.target/i386/pr106994.c: Add -std=gnu17.
	* gcc.target/i386/pr68349.c: Add -std=gnu17.
	* gcc.target/i386/pr97313.c: Add -std=gnu17.
	* gcc.target/i386/pr99454.c: Add -std=gnu17.
	* gcc.target/i386/record-mcount.c: Add -Wno-old-style-definition.

libffi/
	Backport from https://github.com/libffi/libffi/pull/861
	* testsuite/libffi.call/va_struct2.c (test_fn): Cast n to void.
	* testsuite/libffi.call/va_struct3.c (test_fn): Likewise.

Comments

Jakub Jelinek Oct. 16, 2024, 11:15 a.m. UTC | #1
On Wed, Oct 16, 2024 at 11:01:49AM +0000, Joseph Myers wrote:
> --- a/gcc/testsuite/c-c++-common/Wcast-function-type.c
> +++ b/gcc/testsuite/c-c++-common/Wcast-function-type.c
> @@ -1,5 +1,6 @@
>  /* { dg-do compile } */
> -/* { dg-options "-Wcast-function-type" } */
> +/* { dg-options "-std=gnu17 -Wcast-function-type" { target c } } */
> +/* { dg-options "-Wcast-function-type" { target c++ } } */

I think better would be
/* { dg-options "-Wcast-function-type" } */
/* { dg-additional-options "-std=gnu17" { target c } } */

> --- a/gcc/testsuite/c-c++-common/Wformat-pr84258.c
> +++ b/gcc/testsuite/c-c++-common/Wformat-pr84258.c
> @@ -1,4 +1,5 @@
> -/* { dg-options "-Wformat" } */
> +/* { dg-options "-std=gnu17 -Wformat" { target c } } */
> +/* { dg-options "-Wformat" { target c++ } } */

Similarly.

> --- a/gcc/testsuite/c-c++-common/Wvarargs.c
> +++ b/gcc/testsuite/c-c++-common/Wvarargs.c
> @@ -1,4 +1,5 @@
>  /* { dg-do compile } */
> +/* { dg-options "-std=gnu17" { target c } } */

Wasn't the test -pedantic-errors before?
Generally, I'd prefer dg-additional-options for tests
which don't already have dg-options into which one can just add the new
flag, or as in the above cases where a new flag is added only conditionally.
Just am not 100% sure if it works in lto tests...

> --- a/gcc/testsuite/c-c++-common/sizeof-array-argument.c
> +++ b/gcc/testsuite/c-c++-common/sizeof-array-argument.c
> @@ -1,5 +1,6 @@
>  /* PR c/6940 */
>  /* { dg-do compile } */
> +/* { dg-options "-Wno-old-style-definition" { target c } } */

Likewise.

> --- a/gcc/testsuite/gcc.c-torture/compile/20040214-2.c
> +++ b/gcc/testsuite/gcc.c-torture/compile/20040214-2.c
> @@ -1,4 +1,5 @@
>  /* http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01307.html */
> +/* { dg-options "-std=gnu17" } */

I think better use dg-additional-options in gcc.c-torture/
(several times).  Wonder if dg-options e.g. doesn't override the
default -w.

> --- a/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c
> +++ b/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c
> @@ -1,5 +1,6 @@
>  /* { dg-require-visibility "" } */
> -/* { dg-options "-fvisibility=internal -fPIC" { target fpic } } */
> +/* { dg-options "-std=gnu17" { target { ! fpic } } } */
> +/* { dg-options "-std=gnu17 -fvisibility=internal -fPIC" { target fpic } } */

I'd keep it as is + dg-additional-options.  Duplicating the options is
errror-prone.

Otherwise LGTM.

	Jakub
Joseph Myers Oct. 16, 2024, 12:21 p.m. UTC | #2
On Wed, 16 Oct 2024, Jakub Jelinek wrote:

> Generally, I'd prefer dg-additional-options for tests
> which don't already have dg-options into which one can just add the new
> flag, or as in the above cases where a new flag is added only conditionally.
> Just am not 100% sure if it works in lto tests...

Here is a version preferring dg-additional-options to avoid adding 
dg-options where not present or where the number of dg-options lines would 
have to increase because of conditionals.  OK to commit subject to testing 
(including making sure the lto tests do get built with the given options)?



testsuite: Prepare for -std=gnu23 default

Now that C23 support is essentially feature-complete, I'd like to
switch the default language version for C compilation to -std=gnu23.

This requires updating a large number of testcases that fail with the
new language version if left unchanged.  In this patch, update most of
the tests for which there is a safe change that works both before and
after the update to default language version - typically adding the
option -std=gnu17 or -Wno-old-style-definition to the tests.  (There
are also a few tests where I'd like to investigate further why they
fail with -std=gnu23, or where I think such failures show an actual
bug to fix before changing the default language version, or where it
seems more appropriate to make a testcase change that would result in
failures in the absence of the language version change rather than
just adding an option that does nothing with the gnu17 default.)

The libffi test fixes have also been submitted upstream:
<https://github.com/libffi/libffi/pull/861>.

Most of the failures requiring such changes are for one of two
reasons:

* Unprototyped function declarations with () (meaning the same as
  (void) in C23 mode) for a function then called with arguments.

* Old-style function definitions, which warn by default in C23 mode,
  so resulting in test failures for the unexpected warnings.

Other reasons for failures include:

* Tests with their own definitions of bool, true and false.

* Tests of diagnostics (often with -pedantic) in cases where C23 has
  changed semantics, such as:

  - tag compatibility for structs;
  - enum values out of range of int;
  - handing of qualified array types;
  - decimal floating types formerly needing -pedantic diagnostics, but
    being standard in C23.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

gcc/testsuite/
	* c-c++-common/Wcast-function-type.c: Add -std=gnu17 for C.
	* c-c++-common/Wformat-pr84258.c: Add -std=gnu17 for C.
	* c-c++-common/Wvarargs.c: Add -std=gnu17 for C.
	* c-c++-common/analyzer/data-model-12.c: Add -std=gnu17 for C.
	* c-c++-common/builtins.c: Add -std=gnu17 for C.
	* c-c++-common/pointer-to-fn1.c: Add -std=gnu17 for C.
	* c-c++-common/pragma-diag-17.c: Add -std=gnu17 for C.
	* c-c++-common/sizeof-array-argument.c: Add
	-Wno-old-style-definition for C.
	* g++.dg/lto/pr54625-1_0.c: Add -std=gnu17.
	* g++.dg/lto/pr54625-2_0.c: Add -std=gnu17.
	* gcc.c-torture/compile/20040214-2.c: Add -std=gnu17.
	* gcc.c-torture/compile/921011-2.c: Add -std=gnu17.
	* gcc.c-torture/compile/931102-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/990801-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/nested-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr100241-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr106101.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr113616.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr47967.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr51694.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr71109.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr83051-2.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr89663-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr94238.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr96796.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr97576.c: Add -std=gnu17.
	* gcc.c-torture/compile/udivmod4.c: Add -std=gnu17.
	* gcc.c-torture/execute/20010605-2.c: Add -std=gnu17.
	* gcc.c-torture/execute/20020404-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/20030714-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/20051012-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/20190820-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/920612-1.c: Add -Wno-old-style-definition.
	* gcc.c-torture/execute/930608-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/comp-goto-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/ieee/fp-cmp-1.x: Add -std=gnu17.
	* gcc.c-torture/execute/ieee/fp-cmp-2.x: Add -std=gnu17.
	* gcc.c-torture/execute/ieee/fp-cmp-3.x: Add -std=gnu17.
	* gcc.c-torture/execute/ieee/fp-cmp-4.x: New file.
	* gcc.c-torture/execute/ieee/fp-cmp-4f.x: New file.
	* gcc.c-torture/execute/ieee/fp-cmp-4l.x: New file.
	* gcc.c-torture/execute/loop-9.c: Add -std=gnu17.
	* gcc.c-torture/execute/pr103209.c: Add -std=gnu17.
	* gcc.c-torture/execute/pr28289.c: Add -std=gnu17.
	* gcc.c-torture/execute/pr34982.c: Add -std=gnu17.
	* gcc.c-torture/execute/pr67037.c: Add -std=gnu17.
	* gcc.c-torture/execute/va-arg-2.c: Add -std=gnu17.
	* gcc.dg/20010202-1.c: Add -std=gnu17.
	* gcc.dg/20020430-1.c: Add -std=gnu17.
	* gcc.dg/20031218-3.c: Add -std=gnu17.
	* gcc.dg/20040127-1.c: Add -std=gnu17.
	* gcc.dg/20041014-1.c: Add -Wno-old-style-definition.
	* gcc.dg/20041122-1.c: Add -std=gnu17.
	* gcc.dg/20050309-1.c: Add -std=gnu17.
	* gcc.dg/20061026.c: Add -std=gnu17.
	* gcc.dg/20101010-1.c: Add -std=gnu17.
	* gcc.dg/Warray-parameter-10.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch-2.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch-3.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch-4.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch-5.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch.c: Add -std=gnu17.
	* gcc.dg/Wcxx-compat-2.c: Add -std=gnu17.
	* gcc.dg/Wdouble-promotion.c: Add -std=gnu17.
	* gcc.dg/Wfree-nonheap-object-7.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-1.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-1a.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-2.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-3.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-4.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-4a.c: Add -std=gnu17.
	* gcc.dg/Wincompatible-pointer-types-1.c: Add -std=gnu17.
	* gcc.dg/Wrestrict-19.c: Add -std=gnu17.
	* gcc.dg/Wrestrict-4.c: Add -std=gnu17.
	* gcc.dg/Wrestrict-5.c: Add -std=gnu17.
	* gcc.dg/Wstrict-overflow-20.c: Add -std=gnu17.
	* gcc.dg/Wstringop-overflow-13.c: Add -std=gnu17.
	* gcc.dg/analyzer/doom-d_main-IdentifyVersion.c: Add -std=gnu17.
	* gcc.dg/analyzer/doom-s_sound-pr108867.c: Add -std=gnu17.
	* gcc.dg/analyzer/pr93032-mztools-signed-char.c: Add
	-Wno-old-style-definition.
	* gcc.dg/analyzer/pr93032-mztools-unsigned-char.c: Add
	-Wno-old-style-definition.
	* gcc.dg/analyzer/pr93355-localealias.c: Add
	-Wno-old-style-definition.
	* gcc.dg/analyzer/pr93375.c: Add -std=gnu17.
	* gcc.dg/analyzer/pr94688.c: Add -std=gnu17.
	* gcc.dg/analyzer/sensitive-1.c: Add -std=gnu17.
	* gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c:
	Add -std=gnu17.
	* gcc.dg/analyzer/torture/pr104863.c: Add -std=gnu17.
	* gcc.dg/analyzer/torture/pr93379.c: Add -std=gnu17.
	* gcc.dg/array-quals-2.c: Add -std=gnu17.
	* gcc.dg/attr-invalid.c: Add -Wno-old-style-definition.
	* gcc.dg/auto-init-uninit-A.c: Add -Wno-old-style-definition.
	* gcc.dg/builtin-choose-expr.c: Declare exit with (int) prototype.
	* gcc.dg/builtin-tgmath-err-1.c: Add -std=gnu17.
	* gcc.dg/builtins-30.c: Add -std=gnu17.
	* gcc.dg/cast-function-1.c: Add -std=gnu17.
	* gcc.dg/cleanup-1.c: Add -std=gnu17.
	* gcc.dg/compat/struct-complex-1_x.c: Add -std=gnu17.
	* gcc.dg/compat/struct-complex-2_x.c: Add -std=gnu17.
	* gcc.dg/compat/union-m128-1_x.c: Add -std=gnu17.
	* gcc.dg/debug/dwarf2/pr66482.c: Add -std=gnu17.
	* gcc.dg/dfp/composite-type-2.c: Add -std=gnu17.
	* gcc.dg/dfp/composite-type.c: Add -std=gnu17.
	* gcc.dg/dfp/keywords-pedantic.c: Add -std=gnu17.
	* gcc.dg/dremf-type-compat-1.c: Add -std=gnu17.
	* gcc.dg/dremf-type-compat-2.c: Add -std=gnu17.
	* gcc.dg/dremf-type-compat-3.c: Add -std=gnu17.
	* gcc.dg/dremf-type-compat-4.c: Add -std=gnu17.
	* gcc.dg/enum-compat-1.c: Add -std=gnu17.
	* gcc.dg/enum-compat-2.c: Add -std=gnu17.
	* gcc.dg/floatn-errs.c: Add -std=gnu17.
	* gcc.dg/fltconst-pedantic-dfp.c: Add -std=gnu17.
	* gcc.dg/format/proto.c: Add -std=gnu17.
	* gcc.dg/format/sentinel-1.c: Add -std=gnu17.
	* gcc.dg/gomp/declare-simd-1.c: Add -Wno-old-style-definition.
	* gcc.dg/ifelse-1.c: Add -Wno-old-style-definition.
	* gcc.dg/inline-33.c: Add -std=gnu17.
	* gcc.dg/ipa/inline-5.c: Add -std=gnu17.
	* gcc.dg/ipa/ipa-sra-21.c: Add -std=gnu17.
	* gcc.dg/ipa/pr102714.c: Add -std=gnu17.
	* gcc.dg/ipa/pr104813.c: Add -std=gnu17.
	* gcc.dg/ipa/pr108679.c: Add -std=gnu17.
	* gcc.dg/ipa/pr42706.c: Add -std=gnu17.
	* gcc.dg/ipa/pr88214.c: Add -Wno-old-style-definition.
	* gcc.dg/ipa/pr91853.c: Add -Wno-old-style-definition.
	* gcc.dg/ipa/pr93763.c: Add -std=gnu17.
	* gcc.dg/ipa/pr96482-2.c: Add -std=gnu17.
	* gcc.dg/lto/20091013-1_2.c: Add -std=gnu17.
	* gcc.dg/lto/20091015-1_2.c: Add -std=gnu17.
	* gcc.dg/lto/pr113197_1.c: Add -std=gnu17.
	* gcc.dg/lto/pr54702_1.c: Add -std=gnu17.
	* gcc.dg/lto/pr99849_0.c: Add -std=gnu17.
	* gcc.dg/noncompile/920923-1.c: Add -std=gnu17.
	* gcc.dg/noncompile/old-style-parm-1.c: Add
	-Wno-old-style-definition.
	* gcc.dg/noncompile/old-style-parm-3.c: Add
	-Wno-old-style-definition.
	* gcc.dg/noncompile/pr30552-2.c: Add -Wno-old-style-definition.
	* gcc.dg/noncompile/pr30552-3.c: Add -std=gnu17.
	* gcc.dg/noncompile/pr71265.c: Add -Wno-old-style-definition.
	* gcc.dg/noncompile/pr79758-2.c: Add -Wno-old-style-definition.
	* gcc.dg/noncompile/pr79758.c: Add -Wno-old-style-definition.
	* gcc.dg/noncompile/va-arg-1.c: Add -std=gnu17.
	* gcc.dg/old-style-prom-1.c: Add -std=gnu17.
	* gcc.dg/old-style-prom-2.c: Add -std=gnu17.
	* gcc.dg/old-style-prom-3.c: Add -std=gnu17.
	* gcc.dg/old-style-then-proto-1.c: Add -std=gnu17.
	* gcc.dg/parm-incomplete-1.c: Add -std=gnu17.
	* gcc.dg/parm-mismatch-1.c: Add -std=gnu17.
	* gcc.dg/permerror-default.c: Add -std=gnu17.
	* gcc.dg/permerror-fpermissive-nowarning.c: Add -std=gnu17.
	* gcc.dg/permerror-fpermissive.c: Add -std=gnu17.
	* gcc.dg/permerror-noerror.c: Add -std=gnu17.
	* gcc.dg/permerror-nowarning.c: Add -std=gnu17.
	* gcc.dg/permerror-pedantic.c: Add -std=gnu17.
	* gcc.dg/plugin/infoleak-net-ethtool-ioctl.c: Add -std=gnu17.
	* gcc.dg/pointer-array-quals-1.c: Add -std=gnu17.
	* gcc.dg/pointer-array-quals-2.c: Add -std=gnu17.
	* gcc.dg/pr100791.c: Add -std=gnu17.
	* gcc.dg/pr100843.c: Add -std=gnu17.
	* gcc.dg/pr102273.c: Add -std=gnu17.
	* gcc.dg/pr102385.c: Add -std=gnu17.
	* gcc.dg/pr103222.c: Add -std=gnu17.
	* gcc.dg/pr105140.c: Add -std=gnu17.
	* gcc.dg/pr105150.c: Add -std=gnu17.
	* gcc.dg/pr105250.c: Add -std=gnu17.
	* gcc.dg/pr105972.c: Add -Wno-old-style-definition.
	* gcc.dg/pr111039.c: Add -std=gnu17.
	* gcc.dg/pr111407.c: Add -std=gnu17.
	* gcc.dg/pr111922.c: Add -Wno-old-style-definition.
	* gcc.dg/pr15236.c: Add -std=gnu17.
	* gcc.dg/pr17188-1.c: Add -std=gnu17.
	* gcc.dg/pr20368-1.c: Add -std=gnu17.
	* gcc.dg/pr20368-2.c: Add -std=gnu17.
	* gcc.dg/pr20368-3.c: Add -std=gnu17.
	* gcc.dg/pr27331.c: Add -Wno-old-style-definition.
	* gcc.dg/pr27861-1.c: Add -std=gnu17.
	* gcc.dg/pr28121.c: Add -std=gnu17.
	* gcc.dg/pr28243.c: Add -std=gnu17.
	* gcc.dg/pr28888.c: Add -std=gnu17.
	* gcc.dg/pr29254.c: Add -std=gnu17.
	* gcc.dg/pr34457-1.c: Add -std=gnu17.
	* gcc.dg/pr36015.c: Add -std=gnu17.
	* gcc.dg/pr38245-3.c: Add -std=gnu17.
	* gcc.dg/pr38245-4.c: Add -std=gnu17.
	* gcc.dg/pr41241.c: Add -std=gnu17.
	* gcc.dg/pr43058.c: Add -std=gnu17.
	* gcc.dg/pr44539.c: Add -std=gnu17.
	* gcc.dg/pr45055.c: Add -std=gnu17.
	* gcc.dg/pr50908.c: Add -Wno-old-style-definition.
	* gcc.dg/pr60647-1.c: Add -Wno-old-style-definition.
	* gcc.dg/pr63762.c: Add -std=gnu17.
	* gcc.dg/pr63804.c: Add -std=gnu17.
	* gcc.dg/pr68306-3.c: Add -std=gnu17.
	* gcc.dg/pr68533.c: Add -std=gnu17.
	* gcc.dg/pr69156.c: Add -std=gnu17.
	* gcc.dg/pr7356-2.c: Add -Wno-old-style-definition.
	* gcc.dg/pr79983.c: Add -std=gnu17.
	* gcc.dg/pr83463.c: Add -std=gnu17.
	* gcc.dg/pr87347.c: Add -std=gnu17.
	* gcc.dg/pr89521-1.c: Add -std=gnu17.
	* gcc.dg/pr89521-2.c: Add -std=gnu17.
	* gcc.dg/pr90648.c: Add -std=gnu17.
	* gcc.dg/pr93573-1.c: Add -std=gnu17.
	* gcc.dg/pr94167.c: Add -std=gnu17.
	* gcc.dg/pr94705.c: Add -std=gnu17.
	* gcc.dg/pr95118.c: Add -std=gnu17.
	* gcc.dg/pr96335.c: Add -std=gnu17.
	* gcc.dg/pr97830.c: Add -std=gnu17.
	* gcc.dg/pr97882.c: Add -std=gnu17.
	* gcc.dg/pr99122-2.c: Add -std=gnu17.
	* gcc.dg/pr99122-3.c: Add -std=gnu17.
	* gcc.dg/qual-component-1.c: Add -std=gnu17.
	* gcc.dg/sibcall-6.c: Add -Wno-old-style-definition.
	* gcc.dg/sms-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tm/20091221.c: Add -std=gnu17.
	* gcc.dg/torture/bfloat16-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float128-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float128x-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float16-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float32-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float32x-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float64-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float64x-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr102762.c: Add -std=gnu17.
	* gcc.dg/torture/pr103987.c: Add -std=gnu17.
	* gcc.dg/torture/pr104825.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr105166.c: Add -std=gnu17.
	* gcc.dg/torture/pr105185.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr109652.c: Add -std=gnu17.
	* gcc.dg/torture/pr112444.c: Add -std=gnu17.
	* gcc.dg/torture/pr113895-3.c: Add -std=gnu17.
	* gcc.dg/torture/pr24626-2.c: Add -std=gnu17.
	* gcc.dg/torture/pr25183.c: Add -std=gnu17.
	* gcc.dg/torture/pr38948.c: Add -std=gnu17.
	* gcc.dg/torture/pr44807.c: Add -std=gnu17.
	* gcc.dg/torture/pr47281.c: Add -std=gnu17.
	* gcc.dg/torture/pr47958-1.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr48063.c: Add -std=gnu17.
	* gcc.dg/torture/pr57036-1.c: Add -std=gnu17.
	* gcc.dg/torture/pr57330.c: Add -std=gnu17.
	* gcc.dg/torture/pr57584.c: Add -std=gnu17.
	* gcc.dg/torture/pr67741.c: Add -std=gnu17.
	* gcc.dg/torture/pr68104.c: Add -std=gnu17.
	* gcc.dg/torture/pr69242.c: Add -std=gnu17.
	* gcc.dg/torture/pr70457.c: Add -std=gnu17.
	* gcc.dg/torture/pr70985.c: Add -std=gnu17.
	* gcc.dg/torture/pr71606.c: Add -std=gnu17.
	* gcc.dg/torture/pr71816.c: Add -std=gnu17.
	* gcc.dg/torture/pr77286.c: Add -std=gnu17.
	* gcc.dg/torture/pr77646.c: Add -std=gnu17.
	* gcc.dg/torture/pr77677-2.c: Add -std=gnu17.
	* gcc.dg/torture/pr78365.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr79732.c: Add -std=gnu17.
	* gcc.dg/torture/pr80612.c: Add -std=gnu17.
	* gcc.dg/torture/pr80764.c: Add -std=gnu17.
	* gcc.dg/torture/pr80842.c: Add -std=gnu17.
	* gcc.dg/torture/pr81900.c: Add -std=gnu17.
	* gcc.dg/torture/pr82276.c: Add -std=gnu17.
	* gcc.dg/torture/pr84803.c: Add -std=gnu17.
	* gcc.dg/torture/pr93124.c: Add -std=gnu17.
	* gcc.dg/torture/pr97330-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-prof/comp-goto-1.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/20030703-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030708-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030709-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030709-3.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030710-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030711-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030711-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030711-3.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030714-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030714-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030728-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-10.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-11.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-3.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-6.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-7.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030814-4.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030814-5.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030814-6.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030918-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20040514-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/loadpre7.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/pr111003.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr115128.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr115191.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr24840.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr69666.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr70232.c: Add -std=gnu17.
	* gcc.dg/ubsan/pr79757-1.c: Add -Wno-old-style-definition.
	* gcc.dg/ubsan/pr79757-2.c: Add -Wno-old-style-definition.
	* gcc.dg/ubsan/pr79757-3.c: Add -Wno-old-style-definition.
	* gcc.dg/ubsan/pr81223.c: Add -std=gnu17.
	* gcc.dg/uninit-10-O0.c: Add -Wno-old-style-definition.
	* gcc.dg/uninit-10.c: Add -Wno-old-style-definition.
	* gcc.dg/uninit-32.c: Add -std=gnu17.
	* gcc.dg/uninit-41.c: Add -std=gnu17.
	* gcc.dg/uninit-A-O0.c: Add -Wno-old-style-definition.
	* gcc.dg/uninit-A.c: Add -Wno-old-style-definition.
	* gcc.dg/unused-1.c: Add -Wno-old-style-definition.
	* gcc.dg/vect/bb-slp-pr114249.c: Add -std=gnu17.
	* gcc.dg/vect/bb-slp-pr97486.c: Add -std=gnu17.
	* gcc.dg/vect/bb-slp-subgroups-1.c: Add -std=gnu17.
	* gcc.dg/vect/bb-slp-subgroups-2.c: Add -std=gnu17.
	* gcc.dg/vect/bb-slp-subgroups-3.c: Add -std=gnu17.
	* gcc.dg/vect/vect-early-break_111-pr113731.c: Add -std=gnu17.
	* gcc.dg/vect/vect-early-break_122-pr114239.c: Add -std=gnu17.
	* gcc.dg/vect/vect-multi-peel-gaps.c: Add -std=gnu17.
	* gcc.dg/vla-stexp-2.c: Add -std=gnu17.
	* gcc.dg/warn-1.c: Add -Wno-old-style-definition.
	* gcc.dg/winline-10.c: Add -Wno-old-style-definition.
	* gcc.dg/wtr-label-1.c: Add -Wno-old-style-definition.
	* gcc.dg/wtr-switch-1.c: Add -Wno-old-style-definition.
	* gcc.target/i386/excess-precision-3.c: Add
	-Wno-old-style-definition.
	* gcc.target/i386/fma4-256-nmsubXX.c: Add -std=gnu17.
	* gcc.target/i386/fma4-nmsubXX.c: Add -std=gnu17.
	* gcc.target/i386/nop-mcount.c: Add -Wno-old-style-definition.
	* gcc.target/i386/pr102627.c: Add -std=gnu17.
	* gcc.target/i386/pr106994.c: Add -std=gnu17.
	* gcc.target/i386/pr68349.c: Add -std=gnu17.
	* gcc.target/i386/pr97313.c: Add -std=gnu17.
	* gcc.target/i386/pr99454.c: Add -std=gnu17.
	* gcc.target/i386/record-mcount.c: Add -Wno-old-style-definition.

libffi/
	Backport from https://github.com/libffi/libffi/pull/861
	* testsuite/libffi.call/va_struct2.c (test_fn): Cast n to void.
	* testsuite/libffi.call/va_struct3.c (test_fn): Likewise.

diff --git a/gcc/testsuite/c-c++-common/Wcast-function-type.c b/gcc/testsuite/c-c++-common/Wcast-function-type.c
index b49da486814..8f2997d71fa 100644
--- a/gcc/testsuite/c-c++-common/Wcast-function-type.c
+++ b/gcc/testsuite/c-c++-common/Wcast-function-type.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-Wcast-function-type" } */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 
 int f(long);
 
diff --git a/gcc/testsuite/c-c++-common/Wformat-pr84258.c b/gcc/testsuite/c-c++-common/Wformat-pr84258.c
index d2870a88701..10fa9ba2133 100644
--- a/gcc/testsuite/c-c++-common/Wformat-pr84258.c
+++ b/gcc/testsuite/c-c++-common/Wformat-pr84258.c
@@ -1,4 +1,5 @@
 /* { dg-options "-Wformat" } */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 
 int main (int argc, char **argv)
 {
diff --git a/gcc/testsuite/c-c++-common/Wvarargs.c b/gcc/testsuite/c-c++-common/Wvarargs.c
index bfd8276a292..ea86ba30dcd 100644
--- a/gcc/testsuite/c-c++-common/Wvarargs.c
+++ b/gcc/testsuite/c-c++-common/Wvarargs.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 
 #include <stdarg.h>
 
diff --git a/gcc/testsuite/c-c++-common/analyzer/data-model-12.c b/gcc/testsuite/c-c++-common/analyzer/data-model-12.c
index 653b7ad6284..e4a7fbdae44 100644
--- a/gcc/testsuite/c-c++-common/analyzer/data-model-12.c
+++ b/gcc/testsuite/c-c++-common/analyzer/data-model-12.c
@@ -1,4 +1,5 @@
 /* Mismatching decl of foo.  */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 
 int foo ();
 
diff --git a/gcc/testsuite/c-c++-common/builtins.c b/gcc/testsuite/c-c++-common/builtins.c
index 527c77e7952..f44d0d3286b 100644
--- a/gcc/testsuite/c-c++-common/builtins.c
+++ b/gcc/testsuite/c-c++-common/builtins.c
@@ -2,7 +2,7 @@
    with no prototype do not cause an ICE.
   { dg-do compile }
   { dg-options "-O2 -Wall -Wextra" }
-  { dg-additional-options "-fpermissive" { target c } }
+  { dg-additional-options "-std=gnu17 -fpermissive" { target c } }
   { dg-prune-output "warning" }
   { dg-require-effective-target alloca }  */
 
diff --git a/gcc/testsuite/c-c++-common/pointer-to-fn1.c b/gcc/testsuite/c-c++-common/pointer-to-fn1.c
index 70a5831c958..862ca7ab682 100644
--- a/gcc/testsuite/c-c++-common/pointer-to-fn1.c
+++ b/gcc/testsuite/c-c++-common/pointer-to-fn1.c
@@ -1,6 +1,7 @@
 /* PR c++/106937 */
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
 /* { dg-options "-fpermissive -fcf-protection" } */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 /* { dg-additional-options "-std=c++11" { target c++ } } */
 /* Test printing a pointer to function with attribute.  */
 
diff --git a/gcc/testsuite/c-c++-common/pragma-diag-17.c b/gcc/testsuite/c-c++-common/pragma-diag-17.c
index a44ce90f98b..93206f0e35b 100644
--- a/gcc/testsuite/c-c++-common/pragma-diag-17.c
+++ b/gcc/testsuite/c-c++-common/pragma-diag-17.c
@@ -1,5 +1,6 @@
 /* Test silencing the numeric constant extension pedwarns.  */
 /* { dg-options "-pedantic-errors" } */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 /* { dg-additional-options -fext-numeric-literals { target c++14 } } */
 
 #pragma GCC diagnostic push
diff --git a/gcc/testsuite/c-c++-common/sizeof-array-argument.c b/gcc/testsuite/c-c++-common/sizeof-array-argument.c
index eedfceec2cf..f2b2d33289a 100644
--- a/gcc/testsuite/c-c++-common/sizeof-array-argument.c
+++ b/gcc/testsuite/c-c++-common/sizeof-array-argument.c
@@ -1,5 +1,6 @@
 /* PR c/6940 */
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" { target c } } */
 
 /* Test -Wsizeof-array-argument warning.  */
 
diff --git a/gcc/testsuite/g++.dg/lto/pr54625-1_0.c b/gcc/testsuite/g++.dg/lto/pr54625-1_0.c
index b1455e8c90b..59df1aaf58f 100644
--- a/gcc/testsuite/g++.dg/lto/pr54625-1_0.c
+++ b/gcc/testsuite/g++.dg/lto/pr54625-1_0.c
@@ -1,5 +1,5 @@
 /* { dg-lto-do link } */
-/* { dg-lto-options { { -O0 -flto -w } { -O2 -flto -w } }  } */
+/* { dg-lto-options { { -O0 -flto -w -std=gnu17 } { -O2 -flto -w -std=gnu17 } }  } */
 /* { dg-extra-ld-options { -r -nostdlib -flinker-output=nolto-rel } } */
 
 float a;
diff --git a/gcc/testsuite/g++.dg/lto/pr54625-2_0.c b/gcc/testsuite/g++.dg/lto/pr54625-2_0.c
index 1ba463d70e8..b7a53c6bc9a 100644
--- a/gcc/testsuite/g++.dg/lto/pr54625-2_0.c
+++ b/gcc/testsuite/g++.dg/lto/pr54625-2_0.c
@@ -1,5 +1,5 @@
 /* { dg-lto-do link } */
-/* { dg-lto-options { { -O0 -flto -w } { -O2 -flto -w } }  } */
+/* { dg-lto-options { { -O0 -flto -w -std=gnu17 } { -O2 -flto -w -std=gnu17 } }  } */
 /* { dg-extra-ld-options { -r -nostdlib -flinker-output=nolto-rel } } */
 
 float a;
diff --git a/gcc/testsuite/gcc.c-torture/compile/20040214-2.c b/gcc/testsuite/gcc.c-torture/compile/20040214-2.c
index 352d5a5d764..a4fe1d27865 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20040214-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20040214-2.c
@@ -1,4 +1,5 @@
 /* http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01307.html */
+/* { dg-additional-options "-std=gnu17" } */
 
 typedef struct xdef xdef;
 struct xdef
diff --git a/gcc/testsuite/gcc.c-torture/compile/921011-2.c b/gcc/testsuite/gcc.c-torture/compile/921011-2.c
index bf11dad979f..dbee9542021 100644
--- a/gcc/testsuite/gcc.c-torture/compile/921011-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/921011-2.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 extern int foobar1 ();
 
 typedef struct
diff --git a/gcc/testsuite/gcc.c-torture/compile/931102-1.c b/gcc/testsuite/gcc.c-torture/compile/931102-1.c
index f60b2799302..83568c1209b 100644
--- a/gcc/testsuite/gcc.c-torture/compile/931102-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/931102-1.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 char *e ();
 
 #define SET \
diff --git a/gcc/testsuite/gcc.c-torture/compile/990801-1.c b/gcc/testsuite/gcc.c-torture/compile/990801-1.c
index d35ec87b948..6459a1174c9 100644
--- a/gcc/testsuite/gcc.c-torture/compile/990801-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/990801-1.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 extern int getch();
 extern int class();
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/nested-1.c b/gcc/testsuite/gcc.c-torture/compile/nested-1.c
index 135538a8524..7baade75283 100644
--- a/gcc/testsuite/gcc.c-torture/compile/nested-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/nested-1.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target trampolines } */
 
 typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c b/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c
index 593ef96bdb7..1104580a4e6 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c
@@ -1,5 +1,6 @@
 /* { dg-require-visibility "" } */
 /* { dg-options "-fvisibility=internal -fPIC" { target fpic } } */
+/* { dg-additional-options "-std=gnu17" } */
 
 extern char num_4x4_blocks_high_lookup, num_4x4_blocks_wide_lookup,
     vp9_foreach_transformed_block_in_plane_xd_0_0_0;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr106101.c b/gcc/testsuite/gcc.c-torture/compile/pr106101.c
index e307afcbccc..664ecec1053 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr106101.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr106101.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 extern char *globerr;
 char **ftpglob();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr113616.c b/gcc/testsuite/gcc.c-torture/compile/pr113616.c
index 04c38eadffb..a862e8bd91c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr113616.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr113616.c
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-g" }
+// { dg-options "-std=gnu17 -g" }
 struct A { struct A *a; } foo ();
 struct B { long b; };
 struct C { struct B c; struct A d; } *e;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr47967.c b/gcc/testsuite/gcc.c-torture/compile/pr47967.c
index fe1f9c2ef75..39d73c6bfff 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr47967.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr47967.c
@@ -1,4 +1,5 @@
 /* PR tree-optimization/47967 */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target untyped_assembly } */
 
 extern void abort (void);
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr51694.c b/gcc/testsuite/gcc.c-torture/compile/pr51694.c
index 9eddc0bf405..00e6ea378a7 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr51694.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr51694.c
@@ -1,6 +1,6 @@
 /* { dg-require-effective-target untyped_assembly } */
 /* { dg-require-effective-target indirect_calls } */
-/* { dg-additional-options "-fpermissive" } */
+/* { dg-additional-options "-std=gnu17 -fpermissive" } */
 
 void
 foo (x, fn)
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr71109.c b/gcc/testsuite/gcc.c-torture/compile/pr71109.c
index b44ba07123e..fae98fb019d 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr71109.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr71109.c
@@ -1,4 +1,5 @@
 /* PR tree-optimization/71109 */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 struct S { int g, h; signed char i; int j; signed char k; int l[4]; } a, c;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c b/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c
index 4718a276bdb..3d49ed817b0 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fno-early-inlining" } */
+/* { dg-options "-std=gnu17 -fno-early-inlining" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 void
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c b/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c
index 659925d6c87..13ffa903561 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c
@@ -1,4 +1,5 @@
 /* PR middle-end/89663 */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 int irint ();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr94238.c b/gcc/testsuite/gcc.c-torture/compile/pr94238.c
index 5a96a64d85b..0d32cebd9de 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr94238.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr94238.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 enum { false, true } a;
 int b, c, d, e, f;
 int fn3();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr96796.c b/gcc/testsuite/gcc.c-torture/compile/pr96796.c
index debbe62e22f..8deee01237f 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr96796.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr96796.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-fpermissive -fcommon" } */
+/* { dg-additional-options "-std=gnu17 -fpermissive -fcommon" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 struct S0 {
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr97576.c b/gcc/testsuite/gcc.c-torture/compile/pr97576.c
index d2816132cc0..4bcadabcca0 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr97576.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr97576.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 void
diff --git a/gcc/testsuite/gcc.c-torture/compile/udivmod4.c b/gcc/testsuite/gcc.c-torture/compile/udivmod4.c
index 9d98a3d575d..5297dc9d2f1 100644
--- a/gcc/testsuite/gcc.c-torture/compile/udivmod4.c
+++ b/gcc/testsuite/gcc.c-torture/compile/udivmod4.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-fpermissive" } */
+/* { dg-additional-options "-std=gnu17 -fpermissive" } */
 
 long long
 xlrandom ()
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010605-2.c b/gcc/testsuite/gcc.c-torture/execute/20010605-2.c
index 837e0a960d6..ef435bc00ee 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20010605-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20010605-2.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-fpermissive" } */
+/* { dg-additional-options "-std=gnu17 -fpermissive" } */
 
 void foo (), bar (), baz ();
 int main ()
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020404-1.c b/gcc/testsuite/gcc.c-torture/execute/20020404-1.c
index 53b34083400..95b0adc0244 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20020404-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20020404-1.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target int32plus } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-skip-if "pointers can be truncated" { m32c-*-* } } */
 /* Extracted from GDB sources. */
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030714-1.c b/gcc/testsuite/gcc.c-torture/execute/20030714-1.c
index 719baede26f..443fea84dda 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20030714-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20030714-1.c
@@ -1,4 +1,5 @@
 /* derived from PR optimization/11440  */
+/* { dg-additional-options "-std=gnu17" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/20051012-1.c b/gcc/testsuite/gcc.c-torture/execute/20051012-1.c
index d43aeda8285..e9240da06d3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20051012-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20051012-1.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target untyped_assembly } */
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20190820-1.c b/gcc/testsuite/gcc.c-torture/execute/20190820-1.c
index 10e48d35750..c122ff38dac 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20190820-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20190820-1.c
@@ -1,5 +1,6 @@
 /* PR rtl-optimization/91347 */
 /* Reported by John David Anglin <danglin@gcc.gnu.org> */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target int32plus } */
 
 typedef unsigned short __u16;
diff --git a/gcc/testsuite/gcc.c-torture/execute/920612-1.c b/gcc/testsuite/gcc.c-torture/execute/920612-1.c
index 8553de2c5af..2f369b516f9 100644
--- a/gcc/testsuite/gcc.c-torture/execute/920612-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/920612-1.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fwrapv" } */
+/* { dg-options "-Wno-old-style-definition -fwrapv" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/930608-1.c b/gcc/testsuite/gcc.c-torture/execute/930608-1.c
index 1f29aa5d07b..fd267590481 100644
--- a/gcc/testsuite/gcc.c-torture/execute/930608-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/930608-1.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 void abort (void);
 void exit (int);
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
index 6be63c097ac..7bfc9d4f12a 100644
--- a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target label_values } */
 /* { dg-require-stack-size "4000" } */
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x
index 84c193fe0e4..ec107bc50c3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x
@@ -13,4 +13,6 @@ if [istarget "arm*-*-vxworks*"] {
     }
 }
 
+lappend additional_flags "-std=gnu17"
+
 return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x
index 84c193fe0e4..ec107bc50c3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x
@@ -13,4 +13,6 @@ if [istarget "arm*-*-vxworks*"] {
     }
 }
 
+lappend additional_flags "-std=gnu17"
+
 return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x
index 84c193fe0e4..ec107bc50c3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x
@@ -13,4 +13,6 @@ if [istarget "arm*-*-vxworks*"] {
     }
 }
 
+lappend additional_flags "-std=gnu17"
+
 return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.x
new file mode 100644
index 00000000000..9baf8e1cbbb
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.x
@@ -0,0 +1,2 @@
+lappend additional_flags "-std=gnu17"
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.x
new file mode 100644
index 00000000000..9baf8e1cbbb
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.x
@@ -0,0 +1,2 @@
+lappend additional_flags "-std=gnu17"
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.x
new file mode 100644
index 00000000000..9baf8e1cbbb
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.x
@@ -0,0 +1,2 @@
+lappend additional_flags "-std=gnu17"
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-9.c b/gcc/testsuite/gcc.c-torture/execute/loop-9.c
index 523057593a3..c0798c32446 100644
--- a/gcc/testsuite/gcc.c-torture/execute/loop-9.c
+++ b/gcc/testsuite/gcc.c-torture/execute/loop-9.c
@@ -1,4 +1,5 @@
 /* Source: Neil Booth, from PR # 115.  */
+/* { dg-additional-options "-std=gnu17" } */
 
 int false()
 {
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr103209.c b/gcc/testsuite/gcc.c-torture/execute/pr103209.c
index 481689396f4..ecc23129676 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr103209.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr103209.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 #include <stdio.h>
 #include <stdint.h>
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr28289.c b/gcc/testsuite/gcc.c-torture/execute/pr28289.c
index 93e922cbb1f..276a0f4b901 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr28289.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr28289.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 extern int ok (int);
 extern void exit ();
 static int gen_x86_64_shrd (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr34982.c b/gcc/testsuite/gcc.c-torture/execute/pr34982.c
index 1500847d0e8..4289a184249 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr34982.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr34982.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 extern void abort (void);
 
 static void something();
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr67037.c b/gcc/testsuite/gcc.c-torture/execute/pr67037.c
index 3119d327b02..da626e8da8c 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr67037.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr67037.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 long (*extfunc)();
 
 static inline void lstrcpynW( short *d, const short *s, int n )
diff --git a/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c b/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c
index 56f8e14fdde..d44cefc1427 100644
--- a/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c
@@ -2,6 +2,7 @@
    in regs and on the stack.  We test 16 cases, trying to catch multiple
    targets (some use 3 regs for argument passing, some use 12, etc.).
    We test both the arguments and the `lastarg' (the argument to va_start).  */
+/* { dg-additional-options "-std=gnu17" } */
 
 #include <stdarg.h>
 
diff --git a/gcc/testsuite/gcc.dg/20010202-1.c b/gcc/testsuite/gcc.dg/20010202-1.c
index 5f789042eba..418e552cd57 100644
--- a/gcc/testsuite/gcc.dg/20010202-1.c
+++ b/gcc/testsuite/gcc.dg/20010202-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile { target i?86-*-* sparc*-*-* x86_64-*-* } } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.dg/20020430-1.c b/gcc/testsuite/gcc.dg/20020430-1.c
index f48bb672aaf..2690b3835d9 100644
--- a/gcc/testsuite/gcc.dg/20020430-1.c
+++ b/gcc/testsuite/gcc.dg/20020430-1.c
@@ -5,7 +5,7 @@
    which left a reference to the deleted ADDR_VEC.  */
 
 /* { dg-do compile { target fpic } } */
-/* { dg-options "-O2 -frename-registers -fpic" } */
+/* { dg-options "-std=gnu17 -O2 -frename-registers -fpic" } */
 /* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
 
 typedef unsigned long XID;
diff --git a/gcc/testsuite/gcc.dg/20031218-3.c b/gcc/testsuite/gcc.dg/20031218-3.c
index 0bae456b8e7..10f8e775f11 100644
--- a/gcc/testsuite/gcc.dg/20031218-3.c
+++ b/gcc/testsuite/gcc.dg/20031218-3.c
@@ -3,7 +3,7 @@
    The problem was that this just to ICE with -O2 -g.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -g" } */
+/* { dg-options "-std=gnu17 -O2 -g" } */
 
 extern __SIZE_TYPE__ strlen (const char *);
 
diff --git a/gcc/testsuite/gcc.dg/20040127-1.c b/gcc/testsuite/gcc.dg/20040127-1.c
index 0ea6062a5a9..3295dee97e3 100644
--- a/gcc/testsuite/gcc.dg/20040127-1.c
+++ b/gcc/testsuite/gcc.dg/20040127-1.c
@@ -5,7 +5,7 @@
    floating-point registers on SPARC64.  */
 
 /* { dg-do assemble } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 extern int foo1();
 extern int foo2();
diff --git a/gcc/testsuite/gcc.dg/20041014-1.c b/gcc/testsuite/gcc.dg/20041014-1.c
index 699844074ed..b2e9959616d 100644
--- a/gcc/testsuite/gcc.dg/20041014-1.c
+++ b/gcc/testsuite/gcc.dg/20041014-1.c
@@ -1,6 +1,6 @@
 /* PR c/17023 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 void
 f(a, b)
diff --git a/gcc/testsuite/gcc.dg/20041122-1.c b/gcc/testsuite/gcc.dg/20041122-1.c
index b2120f81545..889c7815eb3 100644
--- a/gcc/testsuite/gcc.dg/20041122-1.c
+++ b/gcc/testsuite/gcc.dg/20041122-1.c
@@ -1,6 +1,6 @@
 /* PR rtl-optimization/18611 */
 /* { dg-do compile } */
-/* { dg-options "-O1 -fmove-loop-invariants" } */
+/* { dg-options "-std=gnu17 -O1 -fmove-loop-invariants" } */
 
 void dumpCineonChannelInfo ();
 typedef struct {
diff --git a/gcc/testsuite/gcc.dg/20050309-1.c b/gcc/testsuite/gcc.dg/20050309-1.c
index 46b27f82e29..d17bdaf30bc 100644
--- a/gcc/testsuite/gcc.dg/20050309-1.c
+++ b/gcc/testsuite/gcc.dg/20050309-1.c
@@ -3,7 +3,7 @@
 
 /* { dg-do compile } */
 /* { dg-require-profiling "-fprofile-generate" } */
-/* { dg-options "-O2 -fprofile-generate" } */
+/* { dg-options "-std=gnu17 -O2 -fprofile-generate" } */
 
 void lookup ();
 int hash ();
diff --git a/gcc/testsuite/gcc.dg/20061026.c b/gcc/testsuite/gcc.dg/20061026.c
index fa8069ce4cf..dbba84eab91 100644
--- a/gcc/testsuite/gcc.dg/20061026.c
+++ b/gcc/testsuite/gcc.dg/20061026.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1" } */
+/* { dg-options "-std=gnu17 -O1" } */
 /* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
 
 /* This testcase failed on s390.  The frame size for function f will be
diff --git a/gcc/testsuite/gcc.dg/20101010-1.c b/gcc/testsuite/gcc.dg/20101010-1.c
index 2067012ebcd..d47071742b5 100644
--- a/gcc/testsuite/gcc.dg/20101010-1.c
+++ b/gcc/testsuite/gcc.dg/20101010-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-crossjumping" } */
+/* { dg-options "-std=gnu17 -O2 -fno-crossjumping" } */
 /* { dg-require-effective-target alloca } */
 
 int bar1 ();
diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-10.c b/gcc/testsuite/gcc.dg/Warray-parameter-10.c
index 378f8afbd34..b10a82d0432 100644
--- a/gcc/testsuite/gcc.dg/Warray-parameter-10.c
+++ b/gcc/testsuite/gcc.dg/Warray-parameter-10.c
@@ -1,7 +1,7 @@
 /* PR c/102759 - ICE calling a function taking an argument redeclared
    without a prototype.
    { dg-do compile }
-   { dg-options "-Wall" } */
+   { dg-options "-std=gnu17 -Wall" } */
 
 void f (void)
 {
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-2.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-2.c
index 9d75cd8669c..42733cda815 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-2.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-2.c
@@ -1,7 +1,7 @@
 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
    without prototype
    { dg-do compile }
-   { dg-options "-Wall -Wextra" } */
+   { dg-options "-std=gnu17 -Wall -Wextra" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-3.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-3.c
index bc652793323..91363ed1de5 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-3.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-3.c
@@ -1,7 +1,7 @@
 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
    without prototype
    { dg-do compile }
-   { dg-options "-fpermissive -Wbuiltin-declaration-mismatch" } */
+   { dg-options "-std=gnu17 -fpermissive -Wbuiltin-declaration-mismatch" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
index e845b43c073..c48fe5fcf30 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
@@ -1,7 +1,7 @@
 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
    without prototype
    { dg-do compile }
-   { dg-options "-Wbuiltin-declaration-mismatch" } */
+   { dg-options "-std=gnu17 -Wbuiltin-declaration-mismatch" } */
 
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 typedef __SIZE_TYPE__    size_t;
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-5.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-5.c
index 9cac9277750..08e677e0605 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-5.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-5.c
@@ -1,6 +1,6 @@
 /* PR testsuite/88098 - FAIL: gcc.dg/Wbuiltin-declaration-mismatch-4.c
    { dg-do compile }
-   { dg-options "-Wbuiltin-declaration-mismatch -fshort-enums" } */
+   { dg-options "-std=gnu17 -Wbuiltin-declaration-mismatch -fshort-enums" } */
 
 int abs ();
 double fabs ();     /* { dg-message "built-in .fabs. declared here" } */
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c
index ed66fd3626b..fb456e0421c 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c
@@ -1,7 +1,7 @@
 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
    without prototype
    { dg-do compile }
-   { dg-options "-Wall" } */
+   { dg-options "-std=gnu17 -Wall" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-2.c b/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
index 4578bece109..938414aee8e 100644
--- a/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
+++ b/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
@@ -1,4 +1,4 @@
-/* { dg-options "-Wc++-compat" } */
+/* { dg-options "-std=gnu17 -Wc++-compat" } */
 
 _Bool foo;			/* This is okay.  */
 int bool;			/* { dg-warning "5:keyword" } */
diff --git a/gcc/testsuite/gcc.dg/Wdouble-promotion.c b/gcc/testsuite/gcc.dg/Wdouble-promotion.c
index 0ad77915d8a..c002b2ef148 100644
--- a/gcc/testsuite/gcc.dg/Wdouble-promotion.c
+++ b/gcc/testsuite/gcc.dg/Wdouble-promotion.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -Wdouble-promotion" } */
+/* { dg-options "-std=gnu17 -fpermissive -Wdouble-promotion" } */
 
 #include <stddef.h>
 
diff --git a/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c b/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c
index 6116bfa4d8e..52cfbf9ec5d 100644
--- a/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c
+++ b/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wfree-nonheap-object" } */
+/* { dg-options "-std=gnu17 -O2 -Wfree-nonheap-object" } */
 
 struct local_caches *get_local_caches_lcs;
 void *calloc(long, long);
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-1.c b/gcc/testsuite/gcc.dg/Wimplicit-int-1.c
index fc7726c517e..206db40e4cd 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-1.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 
 static l; /* { dg-warning "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-1a.c b/gcc/testsuite/gcc.dg/Wimplicit-int-1a.c
index ef1835e2d3a..0f7880d117f 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-1a.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-1a.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17 " } */
 
 static l; /* { dg-error "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-2.c b/gcc/testsuite/gcc.dg/Wimplicit-int-2.c
index 4ff16f36738..cd2c1ef2441 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-2.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 static l; /* { dg-error "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-3.c b/gcc/testsuite/gcc.dg/Wimplicit-int-3.c
index 654ce736c25..5980c81afb8 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-3.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors -Wno-implicit-int" } */
+/* { dg-options "-std=gnu17 -pedantic-errors -Wno-implicit-int" } */
 
 static l;
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-4.c b/gcc/testsuite/gcc.dg/Wimplicit-int-4.c
index 99c61a76ecf..28f5da5eed5 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-4.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-4.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -Wno-implicit -Wimplicit-int" } */
+/* { dg-options "-std=gnu17 -fpermissive -Wno-implicit -Wimplicit-int" } */
 
 static l; /* { dg-warning "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-4a.c b/gcc/testsuite/gcc.dg/Wimplicit-int-4a.c
index 920a088f02b..b507620300a 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-4a.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-4a.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Wno-implicit -Wimplicit-int" } */
+/* { dg-options "-std=gnu17 -Wno-implicit -Wimplicit-int" } */
 
 static l; /* { dg-error "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c b/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c
index 4ae7b1d99ce..4e47a30c234 100644
--- a/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c
+++ b/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 void f (int, ...);
 
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-19.c b/gcc/testsuite/gcc.dg/Wrestrict-19.c
index d4750537c55..73b4302fa87 100644
--- a/gcc/testsuite/gcc.dg/Wrestrict-19.c
+++ b/gcc/testsuite/gcc.dg/Wrestrict-19.c
@@ -1,7 +1,7 @@
 /* PR middle-end/89934 - ICE on a call with fewer arguments to strncpy
    declared without prototype
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-std=gnu17 -O2 -Wall" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-4.c b/gcc/testsuite/gcc.dg/Wrestrict-4.c
index a95960e751a..e7b62af9cc7 100644
--- a/gcc/testsuite/gcc.dg/Wrestrict-4.c
+++ b/gcc/testsuite/gcc.dg/Wrestrict-4.c
@@ -4,7 +4,7 @@
    without a prototype don't cause an ICE.
    { dg-do compile }
    { dg-prune-output "conflicting types for built-in" }
-   { dg-options "-O2 -Warray-bounds -Wrestrict" } */
+   { dg-options "-std=gnu17 -O2 -Warray-bounds -Wrestrict" } */
 
 void* memcpy ();
 void* memmove ();
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-5.c b/gcc/testsuite/gcc.dg/Wrestrict-5.c
index 4ea9176f1f5..00f942335b3 100644
--- a/gcc/testsuite/gcc.dg/Wrestrict-5.c
+++ b/gcc/testsuite/gcc.dg/Wrestrict-5.c
@@ -4,7 +4,7 @@
    functions declared with no prototype are checked for overlap, and that
    invalid calls are ignored.
   { dg-do compile }
-  { dg-options "-O2 -fpermissive -Wrestrict" }  */
+  { dg-options "-std=gnu17 -O2 -fpermissive -Wrestrict" }  */
 
 void* memcpy ();
 char* strncpy ();
diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c b/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c
index ae2db93c612..260d20c9c9c 100644
--- a/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c
+++ b/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
+/* { dg-options "-std=gnu17 -fstrict-overflow -O2 -Wstrict-overflow" } */
 
 /* Don't warn about an overflow in a copied loop header.  We used to
    get a warning in value numbering.  This is PR 33565.  */
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
index 021eaae335d..2c882909e7f 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
@@ -3,7 +3,7 @@
    PR middle-end/89911 - ICE on a call with no arguments to strnlen
    declared with no prototype
    { dg-do compile }
-   { dg-options "-O2 -fpermissive -Wall" } */
+   { dg-options "-std=gnu17 -O2 -fpermissive -Wall" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/analyzer/doom-d_main-IdentifyVersion.c b/gcc/testsuite/gcc.dg/analyzer/doom-d_main-IdentifyVersion.c
index 982b9b74349..1605047c423 100644
--- a/gcc/testsuite/gcc.dg/analyzer/doom-d_main-IdentifyVersion.c
+++ b/gcc/testsuite/gcc.dg/analyzer/doom-d_main-IdentifyVersion.c
@@ -1,6 +1,6 @@
 /* Reduced from Doom's d_main.c, which is under the GPLv2 or later.  */
 
-/* { dg-additional-options "-Wno-analyzer-too-complex" } */
+/* { dg-additional-options "-std=gnu17 -Wno-analyzer-too-complex" } */
 
 typedef __SIZE_TYPE__ size_t;
 typedef struct _IO_FILE FILE;
diff --git a/gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c b/gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c
index fdc21a2bec3..ac0a789a7bb 100644
--- a/gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c
+++ b/gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c
@@ -1,6 +1,6 @@
 /* Reduced from Doom's linuxdoom-1.10/s_sound.c, which is GPLv2 or later.  */
 
-/* { dg-additional-options "-fno-analyzer-call-summaries -Wno-analyzer-too-complex -Wno-analyzer-symbol-too-complex" } */
+/* { dg-additional-options "-std=gnu17 -fno-analyzer-call-summaries -Wno-analyzer-too-complex -Wno-analyzer-symbol-too-complex" } */
 /* { dg-require-effective-target size32plus } */
 
 typedef struct _IO_FILE FILE;
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
index 7a7320fca2b..1941e49f9e8 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
@@ -4,7 +4,7 @@
    removed.  */
 
 /* { dg-do "compile" } */
-/* { dg-additional-options "-fsigned-char" } */
+/* { dg-additional-options "-Wno-old-style-definition -fsigned-char" } */
 /* { dg-require-effective-target int32plus } */
 
 /* TODO (PR analyzer/112528): remove need for this.  */
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c
index 10832757127..ca7ab132163 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c
@@ -4,7 +4,7 @@
    removed.  */
 
 /* { dg-do "compile" } */
-/* { dg-additional-options "-funsigned-char" } */
+/* { dg-additional-options "-Wno-old-style-definition -funsigned-char" } */
 /* { dg-require-effective-target int32plus } */
 
 /* TODO (PR analyzer/112528): remove need for this.  */
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c
index 88d0fc1fe43..4ccba46f8da 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c
@@ -3,7 +3,7 @@
    Adapted from intl/localealias.c, with all #includes removed.  */
 
 /* { dg-do "compile" } */
-/* { dg-additional-options "-Wno-analyzer-too-complex" } */
+/* { dg-additional-options "-Wno-old-style-definition -Wno-analyzer-too-complex" } */
 /* TODO: remove the need for this option.  */
 /* { dg-require-effective-target alloca } */
 
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93375.c b/gcc/testsuite/gcc.dg/analyzer/pr93375.c
index f6108547fb7..34ca68b6417 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93375.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93375.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-Wno-implicit-int" } */
+/* { dg-additional-options "-std=gnu17 -Wno-implicit-int" } */
 
 extern void foo (void *) __attribute__((nonnull));
 
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94688.c b/gcc/testsuite/gcc.dg/analyzer/pr94688.c
index 8ea8bc3b288..06152d16f06 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr94688.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94688.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-skip-if "PR112705" { hppa*64*-*-* } } */
 int a, b;
 void d();
diff --git a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
index c66af927617..ee82bb68243 100644
--- a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 #include <stdio.h>
 
 /* Solaris needs this for <unistd.h> to declare getpass.  */
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c
index 4cbf43206dc..f5329d84341 100644
--- a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c
@@ -1,6 +1,6 @@
 /* { dg-do compile { target x86_64-*-* } } */
 /* { dg-require-effective-target lp64 } */
-/* { dg-additional-options "-fsanitize=bounds -fno-analyzer-call-summaries" } */
+/* { dg-additional-options "-std=gnu17 -fsanitize=bounds -fno-analyzer-call-summaries" } */
 /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
 
 /* Reduced from linux kernel: drivers/staging/wfx/sta.c (GPL-2.0)
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/pr104863.c b/gcc/testsuite/gcc.dg/analyzer/torture/pr104863.c
index 30ed4fe022d..6487e966f37 100644
--- a/gcc/testsuite/gcc.dg/analyzer/torture/pr104863.c
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/pr104863.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-fanalyzer-transitivity" } */
+/* { dg-additional-options "-std=gnu17 -fanalyzer-transitivity" } */
 /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
 
 extern void g();
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/pr93379.c b/gcc/testsuite/gcc.dg/analyzer/torture/pr93379.c
index 01465cf60e1..6d6ac1433c8 100644
--- a/gcc/testsuite/gcc.dg/analyzer/torture/pr93379.c
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/pr93379.c
@@ -1,2 +1,3 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 #include "../../torture/pr57330.c"
diff --git a/gcc/testsuite/gcc.dg/array-quals-2.c b/gcc/testsuite/gcc.dg/array-quals-2.c
index 7f33e3fb2ce..e49330d54a4 100644
--- a/gcc/testsuite/gcc.dg/array-quals-2.c
+++ b/gcc/testsuite/gcc.dg/array-quals-2.c
@@ -3,7 +3,7 @@
    lost in forming composite types.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "-pedantic -Wno-discarded-array-qualifiers" } */
+/* { dg-options "-std=gnu17 -pedantic -Wno-discarded-array-qualifiers" } */
 typedef const char T[1];
 typedef const char T2[1];
 typedef volatile char U[1];
diff --git a/gcc/testsuite/gcc.dg/attr-invalid.c b/gcc/testsuite/gcc.dg/attr-invalid.c
index a3315fa131b..87f3cbcfa90 100644
--- a/gcc/testsuite/gcc.dg/attr-invalid.c
+++ b/gcc/testsuite/gcc.dg/attr-invalid.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 #define CONCAT_(A,B) A ## B
 #define CONCAT(A,B) CONCAT_(A,B)
diff --git a/gcc/testsuite/gcc.dg/auto-init-uninit-A.c b/gcc/testsuite/gcc.dg/auto-init-uninit-A.c
index 0ef1d92a747..8347a6081e5 100644
--- a/gcc/testsuite/gcc.dg/auto-init-uninit-A.c
+++ b/gcc/testsuite/gcc.dg/auto-init-uninit-A.c
@@ -2,6 +2,6 @@
    May be a real bug in CSE. */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wall -ftrivial-auto-var-init=zero" } */
+/* { dg-options "-O2 -Wall -Wno-old-style-definition -ftrivial-auto-var-init=zero" } */
 
 #include "uninit-A.c"
diff --git a/gcc/testsuite/gcc.dg/builtin-choose-expr.c b/gcc/testsuite/gcc.dg/builtin-choose-expr.c
index ceac6051f78..e8c14b4f4b7 100644
--- a/gcc/testsuite/gcc.dg/builtin-choose-expr.c
+++ b/gcc/testsuite/gcc.dg/builtin-choose-expr.c
@@ -35,7 +35,7 @@
 
 
 extern void abort ();
-extern void exit ();
+extern void exit (int);
 
 void bad ()
 {
diff --git a/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c b/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c
index 9016ec742be..de764e3776a 100644
--- a/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c
+++ b/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c
@@ -1,7 +1,7 @@
 /* Test __builtin_tgmath: errors that indicate a bad definition of a
    type-generic macro rather than bad arguments in a call to it.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void *p;
 double d;
diff --git a/gcc/testsuite/gcc.dg/builtins-30.c b/gcc/testsuite/gcc.dg/builtins-30.c
index 37e5dba2db6..d6552e5bdcb 100644
--- a/gcc/testsuite/gcc.dg/builtins-30.c
+++ b/gcc/testsuite/gcc.dg/builtins-30.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Wall -Wshadow -fshow-column" } */
+/* { dg-options "-std=gnu17 -Wall -Wshadow -fshow-column" } */
 
 extern double strtod (const char *, char **);
 #define UNUSED __attribute__ ((unused))
diff --git a/gcc/testsuite/gcc.dg/cast-function-1.c b/gcc/testsuite/gcc.dg/cast-function-1.c
index 5228b559165..4bd713611fe 100644
--- a/gcc/testsuite/gcc.dg/cast-function-1.c
+++ b/gcc/testsuite/gcc.dg/cast-function-1.c
@@ -6,7 +6,7 @@
    prototype than the actual one.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O3" } */
+/* { dg-options "-std=gnu17 -O3" } */
 
 int foo1(int);
 int foo2();
diff --git a/gcc/testsuite/gcc.dg/cleanup-1.c b/gcc/testsuite/gcc.dg/cleanup-1.c
index c622a62a4ad..22d590087c6 100644
--- a/gcc/testsuite/gcc.dg/cleanup-1.c
+++ b/gcc/testsuite/gcc.dg/cleanup-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -Wall" } */
+/* { dg-options "-std=gnu17 -fpermissive -Wall" } */
 /* Validate expected warnings and errors.  */
 
 #define U	__attribute__((unused))
diff --git a/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c b/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c
index 0c672394870..ff567a5dd9b 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O -Wno-psabi" } */
+/* { dg-options "-std=gnu17 -O -Wno-psabi" } */
 
 
 #ifdef __x86_64__
diff --git a/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c b/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c
index 2fb9826eb0f..4ad5339ff91 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O -Wno-psabi" } */
+/* { dg-options "-std=gnu17 -O -Wno-psabi" } */
 
 
 #ifdef __x86_64__
diff --git a/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c b/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c
index 1f92303d95b..13044bd9706 100644
--- a/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c
+++ b/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O -msse2" } */
+/* { dg-options "-std=gnu17 -O -msse2" } */
 
 #include "union-m128-1.h"
 
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr66482.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr66482.c
index 880791c72d4..81fac10b5bf 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/pr66482.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr66482.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -gdwarf" } */
+/* { dg-options "-std=gnu17 -O3 -gdwarf" } */
 
 void f(int p) {}
 int g() {
diff --git a/gcc/testsuite/gcc.dg/dfp/composite-type-2.c b/gcc/testsuite/gcc.dg/dfp/composite-type-2.c
index 5c6d95cc200..3ae8a245f24 100644
--- a/gcc/testsuite/gcc.dg/dfp/composite-type-2.c
+++ b/gcc/testsuite/gcc.dg/dfp/composite-type-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O -Wall -ftrack-macro-expansion=0" } */
+/* { dg-options "-std=gnu17 -O -Wall -ftrack-macro-expansion=0" } */
 
 /* C99 6.2.7: Compatible type and composite type.  */
 
diff --git a/gcc/testsuite/gcc.dg/dfp/composite-type.c b/gcc/testsuite/gcc.dg/dfp/composite-type.c
index 2eb601400b5..ead335168d3 100644
--- a/gcc/testsuite/gcc.dg/dfp/composite-type.c
+++ b/gcc/testsuite/gcc.dg/dfp/composite-type.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -O -Wall -ftrack-macro-expansion=0" } */
+/* { dg-options "-std=gnu17 -fpermissive -O -Wall -ftrack-macro-expansion=0" } */
 
 /* C99 6.2.7: Compatible type and composite type.  */
 
diff --git a/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c b/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c
index bca51066be3..5740e024fb2 100644
--- a/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c
+++ b/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
-/* Decimal float is a GCC extension.  */
+/* Decimal float is a GCC extension before C23.  */
 
 _Decimal32 x;		/* { dg-warning "GCC extension|ISO C" } */
 _Decimal64 y;		/* { dg-warning "GCC extension|ISO C" } */
diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-1.c b/gcc/testsuite/gcc.dg/dremf-type-compat-1.c
index 79c55ef840c..79e5d5b5d8c 100644
--- a/gcc/testsuite/gcc.dg/dremf-type-compat-1.c
+++ b/gcc/testsuite/gcc.dg/dremf-type-compat-1.c
@@ -4,7 +4,7 @@
    so it should be permitted when the function is built in.  Bug
    16666.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 float dremf (float, float);
 
diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-2.c b/gcc/testsuite/gcc.dg/dremf-type-compat-2.c
index 980ead187e7..ffb56a73b91 100644
--- a/gcc/testsuite/gcc.dg/dremf-type-compat-2.c
+++ b/gcc/testsuite/gcc.dg/dremf-type-compat-2.c
@@ -5,7 +5,7 @@
    16666.  Test with -pedantic, where the problem should still be
    diagnosed.  */
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
 float dremf (float, float); /* { dg-warning "prototype declaration" } */
 
diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-3.c b/gcc/testsuite/gcc.dg/dremf-type-compat-3.c
index 3934a64e19f..ef36e0b6b12 100644
--- a/gcc/testsuite/gcc.dg/dremf-type-compat-3.c
+++ b/gcc/testsuite/gcc.dg/dremf-type-compat-3.c
@@ -5,7 +5,7 @@
    16666.  Test with -pedantic-errors, where the problem should still
    be diagnosed.  */
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 float dremf (float, float); /* { dg-error "prototype declaration" } */
 
diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-4.c b/gcc/testsuite/gcc.dg/dremf-type-compat-4.c
index b3a2c5ad5d7..27e2204ecff 100644
--- a/gcc/testsuite/gcc.dg/dremf-type-compat-4.c
+++ b/gcc/testsuite/gcc.dg/dremf-type-compat-4.c
@@ -3,7 +3,7 @@
    of old-style parameter declarations should only apply when the
    prototype is visible, not for a built-in prototype.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 float
 dremf(x, y) /* { dg-warning "conflicting types for built-in function 'dremf'" } */
diff --git a/gcc/testsuite/gcc.dg/enum-compat-1.c b/gcc/testsuite/gcc.dg/enum-compat-1.c
index b7352f6ddc3..15890677b6d 100644
--- a/gcc/testsuite/gcc.dg/enum-compat-1.c
+++ b/gcc/testsuite/gcc.dg/enum-compat-1.c
@@ -3,7 +3,7 @@
 /* Origin: Joseph Myers <jsm@polyomino.org.uk>, based on
    PR c/6024 from Richard Earnshaw <rearnsha@arm.com> */
 /* { dg-do compile } */
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 
 /* Original test from PR c/6024.  */
 enum e1 {a, b};
diff --git a/gcc/testsuite/gcc.dg/enum-compat-2.c b/gcc/testsuite/gcc.dg/enum-compat-2.c
index 69509012480..b42717e5939 100644
--- a/gcc/testsuite/gcc.dg/enum-compat-2.c
+++ b/gcc/testsuite/gcc.dg/enum-compat-2.c
@@ -3,7 +3,7 @@
 /* Origin: Joseph Myers <jsm@polyomino.org.uk>, based on
    PR c/6024 from Richard Earnshaw <rearnsha@arm.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 /* Original test from PR c/6024.  */
 enum e1 {a, b};
diff --git a/gcc/testsuite/gcc.dg/floatn-errs.c b/gcc/testsuite/gcc.dg/floatn-errs.c
index 0dcc2f1bb97..9fb3f90262c 100644
--- a/gcc/testsuite/gcc.dg/floatn-errs.c
+++ b/gcc/testsuite/gcc.dg/floatn-errs.c
@@ -1,6 +1,6 @@
 /* Tests for _FloatN / _FloatNx types: test erroneous code.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 /* { dg-add-options float32 } */
 /* { dg-add-options float64 } */
 /* { dg-add-options float32x } */
diff --git a/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c b/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
index 6ff3091ce6a..b395fbdf7ca 100644
--- a/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
+++ b/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
 double a = 1.dl;	/* { dg-warning "decimal float" } */
 /* { dg-error "not supported for this target" "not supported" { target { ! dfp } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/format/proto.c b/gcc/testsuite/gcc.dg/format/proto.c
index b2050c9de5b..2556400b10c 100644
--- a/gcc/testsuite/gcc.dg/format/proto.c
+++ b/gcc/testsuite/gcc.dg/format/proto.c
@@ -4,7 +4,7 @@
    without a prototype.  If it's decided that it shouldn't be the tests
    here will need to be adjusted.
    { dg-do compile }
-   { dg-options "-Wall" } */
+   { dg-options "-std=gnu17 -Wall" } */
 
 #define FMT(n1, n2) __attribute__((__format__(__printf__, n1, n2)))
 
diff --git a/gcc/testsuite/gcc.dg/format/sentinel-1.c b/gcc/testsuite/gcc.dg/format/sentinel-1.c
index 16c75a8a961..d51289a1243 100644
--- a/gcc/testsuite/gcc.dg/format/sentinel-1.c
+++ b/gcc/testsuite/gcc.dg/format/sentinel-1.c
@@ -1,7 +1,7 @@
 /* Test for attribute sentinel.  */
 /* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
 /* { dg-do compile } */
-/* { dg-options "-Wformat" } */
+/* { dg-options "-std=gnu17 -Wformat" } */
 
 #include <stddef.h> /* For NULL, which must be (ptr)0.  */
 
diff --git a/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c b/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c
index c8a99a8c707..8fa12e3da36 100644
--- a/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c
@@ -1,5 +1,6 @@
 /* Test parsing of #pragma omp declare simd */
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 #ifdef __aarch64__
 #pragma omp declare simd uniform (a) aligned (b : 2 * sizeof (int)) \
diff --git a/gcc/testsuite/gcc.dg/ifelse-1.c b/gcc/testsuite/gcc.dg/ifelse-1.c
index 2dd2208b01f..cf111e25ef2 100644
--- a/gcc/testsuite/gcc.dg/ifelse-1.c
+++ b/gcc/testsuite/gcc.dg/ifelse-1.c
@@ -1,6 +1,6 @@
 /*
 { dg-do compile }
-{ dg-options "-W -Wall" }
+{ dg-options "-Wno-old-style-definition -W -Wall" }
 */
 
 
diff --git a/gcc/testsuite/gcc.dg/inline-33.c b/gcc/testsuite/gcc.dg/inline-33.c
index 6ce3a5326b8..a8a409d0b77 100644
--- a/gcc/testsuite/gcc.dg/inline-33.c
+++ b/gcc/testsuite/gcc.dg/inline-33.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-optimized"  } */
+/* { dg-options "-std=gnu17 -O3 -fdump-tree-optimized"  } */
 /* { dg-add-options bind_pic_locally } */
 
 int i;
diff --git a/gcc/testsuite/gcc.dg/ipa/inline-5.c b/gcc/testsuite/gcc.dg/ipa/inline-5.c
index 390ba499d67..cef871cc713 100644
--- a/gcc/testsuite/gcc.dg/ipa/inline-5.c
+++ b/gcc/testsuite/gcc.dg/ipa/inline-5.c
@@ -1,6 +1,6 @@
 /* Check statements that are eliminated by inlining.  */
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-ipa-fnsummary-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp"  } */
+/* { dg-options "-std=gnu17 -O2 -fdump-ipa-fnsummary-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp"  } */
 
 struct a {int a,b,c,d,e;};
 void t(int);
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-21.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-21.c
index 67806b866fe..17c1398a11a 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-21.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-21.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 typedef int a;
 typedef int b;
diff --git a/gcc/testsuite/gcc.dg/ipa/pr102714.c b/gcc/testsuite/gcc.dg/ipa/pr102714.c
index 8ab77a61d75..c93496d0ef5 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr102714.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr102714.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-strict-aliasing -fdump-ipa-sra-details -fdump-tree-optimized" } */
+/* { dg-options "-std=gnu17 -O2 -fno-strict-aliasing -fdump-ipa-sra-details -fdump-tree-optimized" } */
 
 typedef _Bool bool;
 
diff --git a/gcc/testsuite/gcc.dg/ipa/pr104813.c b/gcc/testsuite/gcc.dg/ipa/pr104813.c
index 34f413e3823..13e1e06c597 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr104813.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr104813.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3"  } */
+/* { dg-options "-std=gnu17 -O3"  } */
 
 int a, b, c, d, *e;
 void f(int h) {
diff --git a/gcc/testsuite/gcc.dg/ipa/pr108679.c b/gcc/testsuite/gcc.dg/ipa/pr108679.c
index b1ed50bb831..714cdab653a 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr108679.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr108679.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 struct S1 {
   signed f0;
diff --git a/gcc/testsuite/gcc.dg/ipa/pr42706.c b/gcc/testsuite/gcc.dg/ipa/pr42706.c
index 9c5f43af36f..0cb7d512cfb 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr42706.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr42706.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-early-inlining -fipa-sra"  } */
+/* { dg-options "-std=gnu17 -O2 -fno-early-inlining -fipa-sra"  } */
 
 struct S
 {
diff --git a/gcc/testsuite/gcc.dg/ipa/pr88214.c b/gcc/testsuite/gcc.dg/ipa/pr88214.c
index 4daa9829e75..c621796c140 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr88214.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr88214.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-Wno-old-style-definition -O2" } */
 
 void i();
   short a;
diff --git a/gcc/testsuite/gcc.dg/ipa/pr91853.c b/gcc/testsuite/gcc.dg/ipa/pr91853.c
index 4bad7803751..446096894f4 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr91853.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr91853.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "--param ipa-cp-value-list-size=0 -Os -fno-inline" } */
+/* { dg-options "-Wno-old-style-definition --param ipa-cp-value-list-size=0 -Os -fno-inline" } */
 
 struct _wincore
 {
diff --git a/gcc/testsuite/gcc.dg/ipa/pr93763.c b/gcc/testsuite/gcc.dg/ipa/pr93763.c
index aa2e60c5fc7..6aa4c6ea45e 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr93763.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr93763.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3" } */
+/* { dg-options "-std=gnu17 -O3" } */
 
 typedef struct a a;
 struct a {
diff --git a/gcc/testsuite/gcc.dg/ipa/pr96482-2.c b/gcc/testsuite/gcc.dg/ipa/pr96482-2.c
index 54b71ac4fc0..77c34e52726 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr96482-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr96482-2.c
@@ -1,6 +1,6 @@
 /* PR ipa/96482 */
 /* { dg-do compile } */
-/* { dg-options "-O2"  } */
+/* { dg-options "-std=gnu17 -O2"  } */
 
 int i2c_transfer();
 void _dev_err();
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
index 89caea868e6..283aedb1347 100644
--- a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
@@ -1,4 +1,4 @@
-/* { dg-options "-Wno-stringop-overread" } */
+/* { dg-options "-std=gnu17 -Wno-stringop-overread" } */
 
 typedef struct HDC__ { int unused; } *HDC;
 typedef struct HFONT__ { int unused; } *HFONT;
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_2.c b/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
index 0bc940bc1b1..6ff0b238e3d 100644
--- a/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 #include "20091015-1_a.h"
 #include "20091015-1_b.h"
 void foo ();
diff --git a/gcc/testsuite/gcc.dg/lto/pr113197_1.c b/gcc/testsuite/gcc.dg/lto/pr113197_1.c
index 30bf6f7e7c5..7eda58ff1aa 100644
--- a/gcc/testsuite/gcc.dg/lto/pr113197_1.c
+++ b/gcc/testsuite/gcc.dg/lto/pr113197_1.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 int a;
 void exit_error();
 void register_dccp() { exit_error(a); }
diff --git a/gcc/testsuite/gcc.dg/lto/pr54702_1.c b/gcc/testsuite/gcc.dg/lto/pr54702_1.c
index c304682e92f..7adc6a37419 100644
--- a/gcc/testsuite/gcc.dg/lto/pr54702_1.c
+++ b/gcc/testsuite/gcc.dg/lto/pr54702_1.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 int *b;
 void *d;
 int c;
diff --git a/gcc/testsuite/gcc.dg/lto/pr99849_0.c b/gcc/testsuite/gcc.dg/lto/pr99849_0.c
index d489cee0f52..5c97a7c75a2 100644
--- a/gcc/testsuite/gcc.dg/lto/pr99849_0.c
+++ b/gcc/testsuite/gcc.dg/lto/pr99849_0.c
@@ -3,7 +3,7 @@
 /* { dg-require-effective-target fpic } */
 /* { dg-require-effective-target shared } */
 /* { dg-extra-ld-options { -shared } } */
-/* { dg-lto-options { { -flto -flto-partition=1to1 -O2 -Wno-incompatible-pointer-types -Wno-discarded-qualifiers -fPIC } } } */
+/* { dg-lto-options { { -std=gnu17 -flto -flto-partition=1to1 -O2 -Wno-incompatible-pointer-types -Wno-discarded-qualifiers -fPIC } } } */
 
 struct { struct A *a; } *b;
 struct B { int *b; };
diff --git a/gcc/testsuite/gcc.dg/noncompile/920923-1.c b/gcc/testsuite/gcc.dg/noncompile/920923-1.c
index 006a07131f9..957fea2db65 100644
--- a/gcc/testsuite/gcc.dg/noncompile/920923-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/920923-1.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-message "undeclared identifier is reported only once" "reminder for mmu_base" { target *-*-* } 0 } */
 typedef BYTE unsigned char;	/* { dg-error "expected" } */
 /* { dg-warning "useless type name in empty declaration" ""  { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c b/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c
index 5f879c3f0ae..cf14acdfa13 100644
--- a/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c
@@ -2,7 +2,7 @@
    accepted.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 void
 f(a)
diff --git a/gcc/testsuite/gcc.dg/noncompile/old-style-parm-3.c b/gcc/testsuite/gcc.dg/noncompile/old-style-parm-3.c
index f9d6d0f686a..6c276cae2f9 100644
--- a/gcc/testsuite/gcc.dg/noncompile/old-style-parm-3.c
+++ b/gcc/testsuite/gcc.dg/noncompile/old-style-parm-3.c
@@ -1,5 +1,6 @@
 /* PR c/71266 */
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 int fn1 (a)
   enum b {  /* { dg-warning "empty declaration" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr30552-2.c b/gcc/testsuite/gcc.dg/noncompile/pr30552-2.c
index d88488397c6..8351f5d8ed8 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr30552-2.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr30552-2.c
@@ -5,7 +5,7 @@
  * internal compiler error.  */
 
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 int main()
 {
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c b/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c
index 23cc7e6b253..0e747be1367 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c
@@ -5,7 +5,7 @@
  * user error, not internal compiler error. */
 
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 int main()
 {
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr71265.c b/gcc/testsuite/gcc.dg/noncompile/pr71265.c
index 9c62aab1233..69507b5ade7 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr71265.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr71265.c
@@ -1,5 +1,6 @@
 /* PR c/71265 */
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 void ID (ID)
   int ID [__func__]; /* { dg-error "size of array .ID. has non-integer type" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr79758-2.c b/gcc/testsuite/gcc.dg/noncompile/pr79758-2.c
index e6a27f952ef..2e5323feb31 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr79758-2.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr79758-2.c
@@ -1,5 +1,6 @@
 /* PR c/79758 */
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 void fn1 (int[a]) { }; /* { dg-error "undeclared here" } */
 void fn1 (b) { }; /* { dg-error "redefinition" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr79758.c b/gcc/testsuite/gcc.dg/noncompile/pr79758.c
index e42a44380fa..eab49250d42 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr79758.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr79758.c
@@ -1,6 +1,6 @@
 /* PR c/79758 */
 /* { dg-do compile } */
-/* { dg-additional-options "-fpermissive" } */
+/* { dg-additional-options "-Wno-old-style-definition -fpermissive" } */
 
 void fn1 (int[a]) { }; /* { dg-error "undeclared here" } */
 void fn1 (b) { }; /* { dg-error "redefinition" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c b/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
index f36a492e53d..3a335364ef3 100644
--- a/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 #include <stdarg.h>
 
 void
diff --git a/gcc/testsuite/gcc.dg/old-style-prom-1.c b/gcc/testsuite/gcc.dg/old-style-prom-1.c
index 165ff982708..f9b41397f84 100644
--- a/gcc/testsuite/gcc.dg/old-style-prom-1.c
+++ b/gcc/testsuite/gcc.dg/old-style-prom-1.c
@@ -1,7 +1,7 @@
 /* Test for prototype followed by old-style definition, as in
    dremf-type-compat-1.c but with a non-built-in function.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 float f (float, float);
 
diff --git a/gcc/testsuite/gcc.dg/old-style-prom-2.c b/gcc/testsuite/gcc.dg/old-style-prom-2.c
index e7e690e1417..4a1283b668d 100644
--- a/gcc/testsuite/gcc.dg/old-style-prom-2.c
+++ b/gcc/testsuite/gcc.dg/old-style-prom-2.c
@@ -1,7 +1,7 @@
 /* Test for prototype followed by old-style definition, as in
    dremf-type-compat-2.c but with a non-built-in function.  */
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
 float f (float, float); /* { dg-warning "prototype declaration" } */
 
diff --git a/gcc/testsuite/gcc.dg/old-style-prom-3.c b/gcc/testsuite/gcc.dg/old-style-prom-3.c
index 720367f2e33..e84b39b90f2 100644
--- a/gcc/testsuite/gcc.dg/old-style-prom-3.c
+++ b/gcc/testsuite/gcc.dg/old-style-prom-3.c
@@ -1,7 +1,7 @@
 /* Test for prototype followed by old-style definition, as in
    dremf-type-compat-3.c but with a non-built-in function.  */
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 float f (float, float); /* { dg-error "prototype declaration" } */
 
diff --git a/gcc/testsuite/gcc.dg/old-style-then-proto-1.c b/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
index e3e61861673..d09e76ec6ee 100644
--- a/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
+++ b/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
@@ -2,7 +2,7 @@
    Mismatched qualifiers used to be wrongly forbidden.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void f1() {}
 void f1(void); /* { dg-warning "prototype for 'f1' follows non-prototype definition" } */
diff --git a/gcc/testsuite/gcc.dg/parm-incomplete-1.c b/gcc/testsuite/gcc.dg/parm-incomplete-1.c
index 02d97b933f4..0c0ae85d86f 100644
--- a/gcc/testsuite/gcc.dg/parm-incomplete-1.c
+++ b/gcc/testsuite/gcc.dg/parm-incomplete-1.c
@@ -6,7 +6,7 @@
    C99 6.7.5.3); the precise rules are unclear.  */
 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 struct s;
 void f (struct s);
diff --git a/gcc/testsuite/gcc.dg/parm-mismatch-1.c b/gcc/testsuite/gcc.dg/parm-mismatch-1.c
index d7621bcd6b2..2136f723ad5 100644
--- a/gcc/testsuite/gcc.dg/parm-mismatch-1.c
+++ b/gcc/testsuite/gcc.dg/parm-mismatch-1.c
@@ -2,7 +2,7 @@
    ().  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void f0(); /* { dg-message "note: previous declaration of 'f0'" "note" } */
 void f0(int, ...); /* { dg-error "conflicting types for 'f0'" } */
diff --git a/gcc/testsuite/gcc.dg/permerror-default.c b/gcc/testsuite/gcc.dg/permerror-default.c
index c674d689081..b321a7d6a20 100644
--- a/gcc/testsuite/gcc.dg/permerror-default.c
+++ b/gcc/testsuite/gcc.dg/permerror-default.c
@@ -1,4 +1,4 @@
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 /* Overview test for C permerrors.  This test should be kept in sync with the
    other permerror-* tests.  If new permerrors are added, test cases should be
diff --git a/gcc/testsuite/gcc.dg/permerror-fpermissive-nowarning.c b/gcc/testsuite/gcc.dg/permerror-fpermissive-nowarning.c
index d07c8636677..19629fc952f 100644
--- a/gcc/testsuite/gcc.dg/permerror-fpermissive-nowarning.c
+++ b/gcc/testsuite/gcc.dg/permerror-fpermissive-nowarning.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fpermissive -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-return-mismatch -Wno-declaration-missing-parameter-type" } */
+/* { dg-options "-std=gnu17 -fpermissive -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-return-mismatch -Wno-declaration-missing-parameter-type" } */
 
 /* This test checks that permerrors can be disabled using -Wno-* options even
    if -fpermissive is used.  */
diff --git a/gcc/testsuite/gcc.dg/permerror-fpermissive.c b/gcc/testsuite/gcc.dg/permerror-fpermissive.c
index fd3020d75ee..46a82001620 100644
--- a/gcc/testsuite/gcc.dg/permerror-fpermissive.c
+++ b/gcc/testsuite/gcc.dg/permerror-fpermissive.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 
 /* Overview test for C permerrors.  This test should be kept in sync with the
    other permerror-* tests.  If new permerrors are added, test cases should be
diff --git a/gcc/testsuite/gcc.dg/permerror-noerror.c b/gcc/testsuite/gcc.dg/permerror-noerror.c
index fc68dfa8bb9..614fb06d6e0 100644
--- a/gcc/testsuite/gcc.dg/permerror-noerror.c
+++ b/gcc/testsuite/gcc.dg/permerror-noerror.c
@@ -1,4 +1,4 @@
-/* { dg-options "-Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=int-conversion -Wno-error=incompatible-pointer-types -Wno-error=return-mismatch -Wno-error=declaration-missing-parameter-type" } */
+/* { dg-options "-std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=int-conversion -Wno-error=incompatible-pointer-types -Wno-error=return-mismatch -Wno-error=declaration-missing-parameter-type" } */
 
 /* This test should emulate the effect of -fpermissive by adding all the
    -Wno-error= options that are implied by -fpermissive.  It needs to be
diff --git a/gcc/testsuite/gcc.dg/permerror-nowarning.c b/gcc/testsuite/gcc.dg/permerror-nowarning.c
index b1cf7990127..3182a2474b0 100644
--- a/gcc/testsuite/gcc.dg/permerror-nowarning.c
+++ b/gcc/testsuite/gcc.dg/permerror-nowarning.c
@@ -1,4 +1,4 @@
-/* { dg-options "-Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-return-mismatch -Wno-declaration-missing-parameter-type" } */
+/* { dg-options "-std=gnu17 -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-return-mismatch -Wno-declaration-missing-parameter-type" } */
 
 /* This test checks that permerrors can be disabled using -Wno-* options.  */
 
diff --git a/gcc/testsuite/gcc.dg/permerror-pedantic.c b/gcc/testsuite/gcc.dg/permerror-pedantic.c
index 2380bb2583c..11fa83a8f78 100644
--- a/gcc/testsuite/gcc.dg/permerror-pedantic.c
+++ b/gcc/testsuite/gcc.dg/permerror-pedantic.c
@@ -1,4 +1,4 @@
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 /* Overview test for C permerrors.  This test should be kept in sync with the
    other permerror-* tests.  If new permerrors are added, test cases should be
diff --git a/gcc/testsuite/gcc.dg/plugin/infoleak-net-ethtool-ioctl.c b/gcc/testsuite/gcc.dg/plugin/infoleak-net-ethtool-ioctl.c
index dce6e44ae13..52846c40f86 100644
--- a/gcc/testsuite/gcc.dg/plugin/infoleak-net-ethtool-ioctl.c
+++ b/gcc/testsuite/gcc.dg/plugin/infoleak-net-ethtool-ioctl.c
@@ -2,7 +2,7 @@
    net/ethtool/ioctl.c  */
 
 /* { dg-do compile } */
-/* { dg-options "-fanalyzer" } */
+/* { dg-options "-std=gnu17 -fanalyzer" } */
 /* { dg-require-effective-target analyzer } */
 
 typedef signed char __s8;
diff --git a/gcc/testsuite/gcc.dg/pointer-array-quals-1.c b/gcc/testsuite/gcc.dg/pointer-array-quals-1.c
index be80912723a..36398ef96f0 100644
--- a/gcc/testsuite/gcc.dg/pointer-array-quals-1.c
+++ b/gcc/testsuite/gcc.dg/pointer-array-quals-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Origin: Martin Uecker <uecker@eecs.berkeley.edu> */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 void tvoid(void* x);
 void transpose0(double* out, const double* in) { }
 void transpose1(double out[2][2], const double in[2][2]) { }
diff --git a/gcc/testsuite/gcc.dg/pointer-array-quals-2.c b/gcc/testsuite/gcc.dg/pointer-array-quals-2.c
index 4c95d8a3a78..32adf79bb7d 100644
--- a/gcc/testsuite/gcc.dg/pointer-array-quals-2.c
+++ b/gcc/testsuite/gcc.dg/pointer-array-quals-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 /* Origin: Martin Uecker <uecker@eecs.berkeley.edu> */
 void tvoid(void* x);
 void transpose0(double* out, const double* in) { }
diff --git a/gcc/testsuite/gcc.dg/pr100791.c b/gcc/testsuite/gcc.dg/pr100791.c
index 00cc4b185a3..f0e7da508de 100644
--- a/gcc/testsuite/gcc.dg/pr100791.c
+++ b/gcc/testsuite/gcc.dg/pr100791.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 
 static inline int __attribute__((__always_inline__))
 foo ()
diff --git a/gcc/testsuite/gcc.dg/pr100843.c b/gcc/testsuite/gcc.dg/pr100843.c
index 695a2ec3f68..a8ecb5a0c85 100644
--- a/gcc/testsuite/gcc.dg/pr100843.c
+++ b/gcc/testsuite/gcc.dg/pr100843.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -w" } */
+/* { dg-options "-std=gnu17 -O1 -w" } */
 
 char c;
 void *memset();
diff --git a/gcc/testsuite/gcc.dg/pr102273.c b/gcc/testsuite/gcc.dg/pr102273.c
index 568e44ebfef..2cb396edc81 100644
--- a/gcc/testsuite/gcc.dg/pr102273.c
+++ b/gcc/testsuite/gcc.dg/pr102273.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-options "-std=gnu17 -ftrivial-auto-var-init=zero" } */
 
 void bar();
 
diff --git a/gcc/testsuite/gcc.dg/pr102385.c b/gcc/testsuite/gcc.dg/pr102385.c
index bdccc9e43b1..f64017ef90c 100644
--- a/gcc/testsuite/gcc.dg/pr102385.c
+++ b/gcc/testsuite/gcc.dg/pr102385.c
@@ -1,4 +1,4 @@
-/* { dg-options "-Wall -Wextra -O2 -fno-toplevel-reorder -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-loop-ivcanon -fpredictive-commoning -fdump-tree-pcom-details-blocks -fdump-tree-lim-details-blocks" } */
+/* { dg-options "-std=gnu17 -Wall -Wextra -O2 -fno-toplevel-reorder -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-loop-ivcanon -fpredictive-commoning -fdump-tree-pcom-details-blocks -fdump-tree-lim-details-blocks" } */
 
 short a, b;
 int c[9];
diff --git a/gcc/testsuite/gcc.dg/pr103222.c b/gcc/testsuite/gcc.dg/pr103222.c
index 2a84437b25d..9b629f2fc91 100644
--- a/gcc/testsuite/gcc.dg/pr103222.c
+++ b/gcc/testsuite/gcc.dg/pr103222.c
@@ -1,5 +1,5 @@
 // { dg-do run }
-// { dg-options "-O2" }
+// { dg-options "-std=gnu17 -O2" }
 
 #include <stdint.h>
 #include <stdio.h>
diff --git a/gcc/testsuite/gcc.dg/pr105140.c b/gcc/testsuite/gcc.dg/pr105140.c
index 173dc8c2fac..32267f04f38 100644
--- a/gcc/testsuite/gcc.dg/pr105140.c
+++ b/gcc/testsuite/gcc.dg/pr105140.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -Os -w -Wno-psabi" } */
+/* { dg-options "-std=gnu17 -fpermissive -Os -w -Wno-psabi" } */
 /* { dg-skip-if "PR105147" { powerpc*-*-* s390*-*-* } } */
 
 typedef char __attribute__((__vector_size__ (16 * sizeof (char)))) U;
diff --git a/gcc/testsuite/gcc.dg/pr105150.c b/gcc/testsuite/gcc.dg/pr105150.c
index 900460c1555..b8c35c08308 100644
--- a/gcc/testsuite/gcc.dg/pr105150.c
+++ b/gcc/testsuite/gcc.dg/pr105150.c
@@ -1,5 +1,5 @@
 /* PR tree-optimization/105150 */
-/* { dg-options "-w -Ofast" } */
+/* { dg-options "-std=gnu17 -w -Ofast" } */
 
 #define A(name) __typeof (__builtin_##name (0)) name (); \
   float name##1 () { return !name (1); } \
diff --git a/gcc/testsuite/gcc.dg/pr105250.c b/gcc/testsuite/gcc.dg/pr105250.c
index c4f4ea0c3d7..ba3b0dd930f 100644
--- a/gcc/testsuite/gcc.dg/pr105250.c
+++ b/gcc/testsuite/gcc.dg/pr105250.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -w -Wno-psabi -O2" } */
+/* { dg-options "-std=gnu17 -fpermissive -w -Wno-psabi -O2" } */
 /* { dg-skip-if "PR105266" { powerpc*-*-* s390*-*-* } } */
 
 typedef int __attribute__((__vector_size__(4))) T;
diff --git a/gcc/testsuite/gcc.dg/pr105972.c b/gcc/testsuite/gcc.dg/pr105972.c
index 73f3385f7eb..93518f60f7f 100644
--- a/gcc/testsuite/gcc.dg/pr105972.c
+++ b/gcc/testsuite/gcc.dg/pr105972.c
@@ -1,6 +1,6 @@
 /* PR c/105972 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -g" } */
+/* { dg-options "-Wno-old-style-definition -O2 -g" } */
 
 __attribute__((optimize (0))) int
 foo (void)
diff --git a/gcc/testsuite/gcc.dg/pr111039.c b/gcc/testsuite/gcc.dg/pr111039.c
index a64c46c7edc..0ba142b0a59 100644
--- a/gcc/testsuite/gcc.dg/pr111039.c
+++ b/gcc/testsuite/gcc.dg/pr111039.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O" } */
+/* { dg-options "-std=gnu17 -O" } */
 
 #if __SIZEOF_INT__ < 4
 #define int __INT32_TYPE__
diff --git a/gcc/testsuite/gcc.dg/pr111407.c b/gcc/testsuite/gcc.dg/pr111407.c
index a171074753f..211e19f899f 100644
--- a/gcc/testsuite/gcc.dg/pr111407.c
+++ b/gcc/testsuite/gcc.dg/pr111407.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/111407*/
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 enum { SEND_TOFILE } __sigsetjmp();
 void fclose();
 void foldergets();
diff --git a/gcc/testsuite/gcc.dg/pr111922.c b/gcc/testsuite/gcc.dg/pr111922.c
index 4f429d741c7..7201c0ef215 100644
--- a/gcc/testsuite/gcc.dg/pr111922.c
+++ b/gcc/testsuite/gcc.dg/pr111922.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-tree-fre" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fno-tree-fre" } */
 
 void f2 (void);
 void f4 (int, int, int);
diff --git a/gcc/testsuite/gcc.dg/pr15236.c b/gcc/testsuite/gcc.dg/pr15236.c
index b01a4e85873..9b92489738d 100644
--- a/gcc/testsuite/gcc.dg/pr15236.c
+++ b/gcc/testsuite/gcc.dg/pr15236.c
@@ -1,7 +1,7 @@
 /* PR 15236: pedantic switch modifies treatment of non-ISO compliant
    enumerations.  */
 /* { dg-do compile } */
-/* { dg-options "-Wall -Wextra -pedantic-errors -Wconversion" } */
+/* { dg-options "-std=gnu17 -Wall -Wextra -pedantic-errors -Wconversion" } */
 typedef enum OMX_ERRORTYPE
 {
   OMX_ErrorNone = 0,
diff --git a/gcc/testsuite/gcc.dg/pr17188-1.c b/gcc/testsuite/gcc.dg/pr17188-1.c
index 522a14f7d75..142f42acdac 100644
--- a/gcc/testsuite/gcc.dg/pr17188-1.c
+++ b/gcc/testsuite/gcc.dg/pr17188-1.c
@@ -3,7 +3,7 @@
    diagnosed.  Bug 17188.  */
 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 struct s0 { }; /* { dg-message "note: originally defined here" } */
 struct s0;
diff --git a/gcc/testsuite/gcc.dg/pr20368-1.c b/gcc/testsuite/gcc.dg/pr20368-1.c
index 4140397c142..2959328e6a6 100644
--- a/gcc/testsuite/gcc.dg/pr20368-1.c
+++ b/gcc/testsuite/gcc.dg/pr20368-1.c
@@ -1,7 +1,7 @@
 /* ICE with -Wstrict-prototypes and typeof an undeclared function.
    Bug 20368.  */
 /* { dg-do compile } */
-/* { dg-options "-Wstrict-prototypes" } */
+/* { dg-options "-std=gnu17 -Wstrict-prototypes" } */
 
 extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */
 
diff --git a/gcc/testsuite/gcc.dg/pr20368-2.c b/gcc/testsuite/gcc.dg/pr20368-2.c
index 7faded6bd8c..3ca5f6363a3 100644
--- a/gcc/testsuite/gcc.dg/pr20368-2.c
+++ b/gcc/testsuite/gcc.dg/pr20368-2.c
@@ -1,7 +1,7 @@
 /* ICE with -Wstrict-prototypes and typeof an undeclared function.
    Bug 20368.  Test with -Wmissing-prototypes.  */
 /* { dg-do compile } */
-/* { dg-options "-Wmissing-prototypes" } */
+/* { dg-options "-std=gnu17 -Wmissing-prototypes" } */
 
 extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */
 
diff --git a/gcc/testsuite/gcc.dg/pr20368-3.c b/gcc/testsuite/gcc.dg/pr20368-3.c
index 0d0ea6dfcc3..e3b5194efa0 100644
--- a/gcc/testsuite/gcc.dg/pr20368-3.c
+++ b/gcc/testsuite/gcc.dg/pr20368-3.c
@@ -1,7 +1,7 @@
 /* ICE with -Wstrict-prototypes and typeof an undeclared function.
    Bug 20368.  Test with -Wmissing-declarations.  */
 /* { dg-do compile } */
-/* { dg-options "-Wmissing-declarations" } */
+/* { dg-options "-std=gnu17 -Wmissing-declarations" } */
 
 extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */
 
diff --git a/gcc/testsuite/gcc.dg/pr27331.c b/gcc/testsuite/gcc.dg/pr27331.c
index 9b5c71e8437..50ec9a1f625 100644
--- a/gcc/testsuite/gcc.dg/pr27331.c
+++ b/gcc/testsuite/gcc.dg/pr27331.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize" } */
+/* { dg-options "-Wno-old-style-definition -O2 -ftree-vectorize" } */
 
 struct funny_match
 {
diff --git a/gcc/testsuite/gcc.dg/pr27861-1.c b/gcc/testsuite/gcc.dg/pr27861-1.c
index 8d6d791bcac..e8f86f289ca 100644
--- a/gcc/testsuite/gcc.dg/pr27861-1.c
+++ b/gcc/testsuite/gcc.dg/pr27861-1.c
@@ -4,7 +4,7 @@
    later producing a VAR_DECL tree whose DECL_RTL's mode didn't match
    the VAR_DECL's type's mode.  */
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 typedef struct sim_state *SIM_DESC;
 typedef enum
diff --git a/gcc/testsuite/gcc.dg/pr28121.c b/gcc/testsuite/gcc.dg/pr28121.c
index 9e306f5930a..93d065fc2c3 100644
--- a/gcc/testsuite/gcc.dg/pr28121.c
+++ b/gcc/testsuite/gcc.dg/pr28121.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 int GetMouseButton ();
 int ParsePos ();
diff --git a/gcc/testsuite/gcc.dg/pr28243.c b/gcc/testsuite/gcc.dg/pr28243.c
index a6d693e224c..fd08b9926fd 100644
--- a/gcc/testsuite/gcc.dg/pr28243.c
+++ b/gcc/testsuite/gcc.dg/pr28243.c
@@ -3,7 +3,7 @@
 
 /* { dg-do compile } */
 /* { dg-require-effective-target fpic } */
-/* { dg-options "-O2 -ftracer -fPIC" } */
+/* { dg-options "-std=gnu17 -O2 -ftracer -fPIC" } */
 
 struct displayfuncs {
   void (*init) ();
diff --git a/gcc/testsuite/gcc.dg/pr28888.c b/gcc/testsuite/gcc.dg/pr28888.c
index 3bad18b9fdf..dea52f1b269 100644
--- a/gcc/testsuite/gcc.dg/pr28888.c
+++ b/gcc/testsuite/gcc.dg/pr28888.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize" } */
+/* { dg-options "-std=gnu17 -O2 -ftree-vectorize" } */
 
 static const unsigned char _c30[] =
   "statistic of allocated integer registers:";
diff --git a/gcc/testsuite/gcc.dg/pr29254.c b/gcc/testsuite/gcc.dg/pr29254.c
index df6ba574a5d..1770a9710b7 100644
--- a/gcc/testsuite/gcc.dg/pr29254.c
+++ b/gcc/testsuite/gcc.dg/pr29254.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -Werror" } */
+/* { dg-options "-std=gnu17 -O3 -Werror" } */
 
 int value_compare ();
 
diff --git a/gcc/testsuite/gcc.dg/pr34457-1.c b/gcc/testsuite/gcc.dg/pr34457-1.c
index 3dca13df093..ef2419f4535 100644
--- a/gcc/testsuite/gcc.dg/pr34457-1.c
+++ b/gcc/testsuite/gcc.dg/pr34457-1.c
@@ -2,7 +2,7 @@
 /* { dg-do link } */
 /* { dg-require-effective-target trampolines } */
 /* { dg-require-effective-target lto } */
-/* { dg-options "-flto -O2" } */
+/* { dg-options "-std=gnu17 -flto -O2" } */
 /* { dg-additional-sources "pr34457-2.c" } */
    
 
diff --git a/gcc/testsuite/gcc.dg/pr36015.c b/gcc/testsuite/gcc.dg/pr36015.c
index fc31535598d..85b441c63c1 100644
--- a/gcc/testsuite/gcc.dg/pr36015.c
+++ b/gcc/testsuite/gcc.dg/pr36015.c
@@ -1,7 +1,7 @@
 /* PR target/36015 */
 /* { dg-do run } */
-/* { dg-options "-O0" } */
-/* { dg-options "-O0 -mregparm=3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-std=gnu17 -O0" } */
+/* { dg-options "-std=gnu17 -O0 -mregparm=3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 static int test ();
 
diff --git a/gcc/testsuite/gcc.dg/pr38245-3.c b/gcc/testsuite/gcc.dg/pr38245-3.c
index 6ef8372a14f..ae687c68efa 100644
--- a/gcc/testsuite/gcc.dg/pr38245-3.c
+++ b/gcc/testsuite/gcc.dg/pr38245-3.c
@@ -1,7 +1,7 @@
 /* PR rtl-optimization/38245 */
 /* { dg-do run } */
 /* { dg-additional-sources "pr38245-4.c" } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 #include "pr38245-3.h"
 
diff --git a/gcc/testsuite/gcc.dg/pr38245-4.c b/gcc/testsuite/gcc.dg/pr38245-4.c
index c9b3d2d8fb8..7b63b989ffa 100644
--- a/gcc/testsuite/gcc.dg/pr38245-4.c
+++ b/gcc/testsuite/gcc.dg/pr38245-4.c
@@ -1,6 +1,6 @@
 /* PR rtl-optimization/38245 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 #include "pr38245-3.h"
 
diff --git a/gcc/testsuite/gcc.dg/pr41241.c b/gcc/testsuite/gcc.dg/pr41241.c
index 42fb2f7e5c7..5364a0a5935 100644
--- a/gcc/testsuite/gcc.dg/pr41241.c
+++ b/gcc/testsuite/gcc.dg/pr41241.c
@@ -1,7 +1,7 @@
 /* PR bootstrap/41241 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -fcompare-debug -g" } */
-/* { dg-options "-O2 -fcompare-debug -g -march=i586 -mtune=i586 -fomit-frame-pointer" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-std=gnu17 -O2 -fcompare-debug -g" } */
+/* { dg-options "-std=gnu17 -O2 -fcompare-debug -g -march=i586 -mtune=i586 -fomit-frame-pointer" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 typedef struct { int t1; int t2; int t3; } *T;
 typedef struct { int s; } S;
diff --git a/gcc/testsuite/gcc.dg/pr43058.c b/gcc/testsuite/gcc.dg/pr43058.c
index bba6f814a71..c1ba39c1242 100644
--- a/gcc/testsuite/gcc.dg/pr43058.c
+++ b/gcc/testsuite/gcc.dg/pr43058.c
@@ -1,6 +1,6 @@
 /* PR debug/43058 */
 /* { dg-do compile } */
-/* { dg-options "-g -O2" } */
+/* { dg-options "-std=gnu17 -g -O2" } */
 /* { dg-timeout-factor 4 } */
 
 extern void *f1 (void *, void *, void *);
diff --git a/gcc/testsuite/gcc.dg/pr44539.c b/gcc/testsuite/gcc.dg/pr44539.c
index 9cfff7a3ae5..cb9a631dead 100644
--- a/gcc/testsuite/gcc.dg/pr44539.c
+++ b/gcc/testsuite/gcc.dg/pr44539.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/44539 */
 /* { dg-do compile } */
-/* { dg-options "-ftracer -freorder-blocks -O2" } */
+/* { dg-options "-std=gnu17 -ftracer -freorder-blocks -O2" } */
 
 void bar (int file);
 extern int baz (void);
diff --git a/gcc/testsuite/gcc.dg/pr45055.c b/gcc/testsuite/gcc.dg/pr45055.c
index 899de50498b..305f8239150 100644
--- a/gcc/testsuite/gcc.dg/pr45055.c
+++ b/gcc/testsuite/gcc.dg/pr45055.c
@@ -1,6 +1,6 @@
 /* PR debug/45055 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftracer -fsched-pressure -funroll-loops -fschedule-insns -fcompare-debug" } */
+/* { dg-options "-std=gnu17 -O2 -ftracer -fsched-pressure -funroll-loops -fschedule-insns -fcompare-debug" } */
 /* { dg-require-effective-target scheduling } */
 
 int colormap[10];
diff --git a/gcc/testsuite/gcc.dg/pr50908.c b/gcc/testsuite/gcc.dg/pr50908.c
index 114dded3ab1..3083a527c30 100644
--- a/gcc/testsuite/gcc.dg/pr50908.c
+++ b/gcc/testsuite/gcc.dg/pr50908.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target lp64 } */
-/* { dg-options "-O2 -ftree-tail-merge" } */
+/* { dg-options "-Wno-old-style-definition -O2 -ftree-tail-merge" } */
 
 enum Lisp_Type
 {
diff --git a/gcc/testsuite/gcc.dg/pr60647-1.c b/gcc/testsuite/gcc.dg/pr60647-1.c
index 99f5919c34c..e5d77f2e52e 100644
--- a/gcc/testsuite/gcc.dg/pr60647-1.c
+++ b/gcc/testsuite/gcc.dg/pr60647-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-Wno-old-style-definition -O2" } */
 
 struct _wincore
 {
diff --git a/gcc/testsuite/gcc.dg/pr63762.c b/gcc/testsuite/gcc.dg/pr63762.c
index df110676eca..8de8e63bfc0 100644
--- a/gcc/testsuite/gcc.dg/pr63762.c
+++ b/gcc/testsuite/gcc.dg/pr63762.c
@@ -1,6 +1,6 @@
 /* PR middle-end/63762 */
 /* { dg-do assemble } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 #include <stdlib.h>
 
diff --git a/gcc/testsuite/gcc.dg/pr63804.c b/gcc/testsuite/gcc.dg/pr63804.c
index f0a02f26ae4..f92822add96 100644
--- a/gcc/testsuite/gcc.dg/pr63804.c
+++ b/gcc/testsuite/gcc.dg/pr63804.c
@@ -1,6 +1,6 @@
 /* PR rtl-optimization/63804 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -g" } */
+/* { dg-options "-std=gnu17 -O2 -g" } */
 
 struct A { int gen; } e;
 int a, d;
diff --git a/gcc/testsuite/gcc.dg/pr68306-3.c b/gcc/testsuite/gcc.dg/pr68306-3.c
index f5a8c102cf8..cac464f492e 100644
--- a/gcc/testsuite/gcc.dg/pr68306-3.c
+++ b/gcc/testsuite/gcc.dg/pr68306-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3" } */
+/* { dg-options "-std=gnu17 -O3" } */
 /* { dg-additional-options "-mno-sse -mno-mmx" { target i?86-*-* x86_64-*-* } } */
 /* { dg-additional-options "-mno-altivec -mno-vsx" { target powerpc*-*-* } } */
 
diff --git a/gcc/testsuite/gcc.dg/pr68533.c b/gcc/testsuite/gcc.dg/pr68533.c
index 49e67a96168..5e9a4c6c991 100644
--- a/gcc/testsuite/gcc.dg/pr68533.c
+++ b/gcc/testsuite/gcc.dg/pr68533.c
@@ -1,6 +1,6 @@
 /* PR c/68533 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 struct T { int t; };
 
diff --git a/gcc/testsuite/gcc.dg/pr69156.c b/gcc/testsuite/gcc.dg/pr69156.c
index 5740971383c..97b46aaa0e8 100644
--- a/gcc/testsuite/gcc.dg/pr69156.c
+++ b/gcc/testsuite/gcc.dg/pr69156.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/69156 */
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -O1 -fno-tree-ccp" } */
+/* { dg-options "-std=gnu17 -fpermissive -O1 -fno-tree-ccp" } */
 
 _Bool
 foo ()
diff --git a/gcc/testsuite/gcc.dg/pr7356-2.c b/gcc/testsuite/gcc.dg/pr7356-2.c
index ad679756978..9bed60d435d 100644
--- a/gcc/testsuite/gcc.dg/pr7356-2.c
+++ b/gcc/testsuite/gcc.dg/pr7356-2.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fdiagnostics-show-caret" } */
+/* { dg-options "-Wno-old-style-definition -fdiagnostics-show-caret" } */
 
 int i /* { dg-error "6: expected ';' before 'int'" } */
 int j;
diff --git a/gcc/testsuite/gcc.dg/pr79983.c b/gcc/testsuite/gcc.dg/pr79983.c
index 1e292d42108..2cf83004b7c 100644
--- a/gcc/testsuite/gcc.dg/pr79983.c
+++ b/gcc/testsuite/gcc.dg/pr79983.c
@@ -1,6 +1,6 @@
 /* PR c/79983 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 struct S;
 struct S { int i; }; /* { dg-message "originally defined here" } */
diff --git a/gcc/testsuite/gcc.dg/pr83463.c b/gcc/testsuite/gcc.dg/pr83463.c
index 9142d273e7c..2af130cf3b0 100644
--- a/gcc/testsuite/gcc.dg/pr83463.c
+++ b/gcc/testsuite/gcc.dg/pr83463.c
@@ -1,7 +1,7 @@
 /* PR middle-end/83463 */
 /* { dg-do compile } */
 /* { dg-prune-output "conflicting types for built-in" } */
-/* { dg-options "-O2 -Wrestrict -Wno-pointer-to-int-cast" } */
+/* { dg-options "-std=gnu17 -O2 -Wrestrict -Wno-pointer-to-int-cast" } */
 
 int *a;
 void *memcpy ();
diff --git a/gcc/testsuite/gcc.dg/pr87347.c b/gcc/testsuite/gcc.dg/pr87347.c
index 2077964e9d3..009f95904fc 100644
--- a/gcc/testsuite/gcc.dg/pr87347.c
+++ b/gcc/testsuite/gcc.dg/pr87347.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Wabsolute-value" } */
+/* { dg-options "-std=gnu17 -Wabsolute-value" } */
 
 int a;
 int abs();
diff --git a/gcc/testsuite/gcc.dg/pr89521-1.c b/gcc/testsuite/gcc.dg/pr89521-1.c
index ebf2c5932c3..282c4f8b5ee 100644
--- a/gcc/testsuite/gcc.dg/pr89521-1.c
+++ b/gcc/testsuite/gcc.dg/pr89521-1.c
@@ -1,6 +1,6 @@
 /* PR c/89521 */
 /* { dg-do compile } */
-/* { dg-options "-Ofast -w" } */
+/* { dg-options "-std=gnu17 -Ofast -w" } */
 
 #define A(name) __typeof (__builtin_##name (0)) name (); long name##1 () { return name (1); }
 #define B(name) A(name) A(name##f) A(name##l)
diff --git a/gcc/testsuite/gcc.dg/pr89521-2.c b/gcc/testsuite/gcc.dg/pr89521-2.c
index 5e37c918fc2..b5ef8860e55 100644
--- a/gcc/testsuite/gcc.dg/pr89521-2.c
+++ b/gcc/testsuite/gcc.dg/pr89521-2.c
@@ -1,6 +1,6 @@
 /* PR c/89521 */
 /* { dg-do compile } */
-/* { dg-options "-Ofast -w" } */
+/* { dg-options "-std=gnu17 -Ofast -w" } */
 
 #define A(name) __typeof (__builtin_##name (0)) name (); \
   float name##1 () { return name (1); } \
diff --git a/gcc/testsuite/gcc.dg/pr90648.c b/gcc/testsuite/gcc.dg/pr90648.c
index bf1fa989478..5a9922d5f87 100644
--- a/gcc/testsuite/gcc.dg/pr90648.c
+++ b/gcc/testsuite/gcc.dg/pr90648.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O" } */
+/* { dg-options "-std=gnu17 -O" } */
 
 extern double copysign ();
 double foo (double x)
diff --git a/gcc/testsuite/gcc.dg/pr93573-1.c b/gcc/testsuite/gcc.dg/pr93573-1.c
index 26ec9b77d6f..50a1c9747a9 100644
--- a/gcc/testsuite/gcc.dg/pr93573-1.c
+++ b/gcc/testsuite/gcc.dg/pr93573-1.c
@@ -1,6 +1,6 @@
 /* PR c/93573 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void bar ();
 
diff --git a/gcc/testsuite/gcc.dg/pr94167.c b/gcc/testsuite/gcc.dg/pr94167.c
index 4b819d3a869..efc87ab03fa 100644
--- a/gcc/testsuite/gcc.dg/pr94167.c
+++ b/gcc/testsuite/gcc.dg/pr94167.c
@@ -1,6 +1,6 @@
 /* PR debug/94167 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -fcompare-debug" } */
+/* { dg-options "-std=gnu17 -O2 -fcompare-debug" } */
 
 struct S { int g, h; signed char i; int j; signed char k; int l[4]; } a, c;
 struct T { signed char g; } e;
diff --git a/gcc/testsuite/gcc.dg/pr94705.c b/gcc/testsuite/gcc.dg/pr94705.c
index 96392ab60ee..6bd92f171e4 100644
--- a/gcc/testsuite/gcc.dg/pr94705.c
+++ b/gcc/testsuite/gcc.dg/pr94705.c
@@ -1,6 +1,6 @@
 /* PR c/94705 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void foo ();
 
diff --git a/gcc/testsuite/gcc.dg/pr95118.c b/gcc/testsuite/gcc.dg/pr95118.c
index 69bc47fd7aa..59173e6c577 100644
--- a/gcc/testsuite/gcc.dg/pr95118.c
+++ b/gcc/testsuite/gcc.dg/pr95118.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-fre" } */
+/* { dg-options "-std=gnu17 -O2 -fdump-tree-fre" } */
 
 void a();
 void b() {
diff --git a/gcc/testsuite/gcc.dg/pr96335.c b/gcc/testsuite/gcc.dg/pr96335.c
index ab243b3d129..a6203f38a03 100644
--- a/gcc/testsuite/gcc.dg/pr96335.c
+++ b/gcc/testsuite/gcc.dg/pr96335.c
@@ -1,6 +1,6 @@
 /* PR middle-end/96335 */
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 void bar (int, void *) __attribute__((__access__(__read_only__, 2)));
 
diff --git a/gcc/testsuite/gcc.dg/pr97830.c b/gcc/testsuite/gcc.dg/pr97830.c
index 3729a65aec2..fd79620e770 100644
--- a/gcc/testsuite/gcc.dg/pr97830.c
+++ b/gcc/testsuite/gcc.dg/pr97830.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 typedef enum { LangC } cLanguage;
 typedef enum { FunctionOneArg, FunctionStandard } cFunctionType;
diff --git a/gcc/testsuite/gcc.dg/pr97882.c b/gcc/testsuite/gcc.dg/pr97882.c
index 48ea93d53c7..6666f898562 100644
--- a/gcc/testsuite/gcc.dg/pr97882.c
+++ b/gcc/testsuite/gcc.dg/pr97882.c
@@ -1,6 +1,6 @@
 /* PR c/97882 - Segmentation Fault on improper redeclaration of function
    { dg-do compile }
-   { dg-options "" } */
+   { dg-options "-std=gnu17" } */
 
 // Check pointer declaration incompatibiliies.
 
diff --git a/gcc/testsuite/gcc.dg/pr99122-2.c b/gcc/testsuite/gcc.dg/pr99122-2.c
index c0c850f141c..3947f7dcdc8 100644
--- a/gcc/testsuite/gcc.dg/pr99122-2.c
+++ b/gcc/testsuite/gcc.dg/pr99122-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -g -w" } */
+/* { dg-options "-std=gnu17 -O2 -g -w" } */
 /* { dg-require-effective-target alloca } */
 
 static int foo ();
diff --git a/gcc/testsuite/gcc.dg/pr99122-3.c b/gcc/testsuite/gcc.dg/pr99122-3.c
index 6a908ad86c0..3e72a303277 100644
--- a/gcc/testsuite/gcc.dg/pr99122-3.c
+++ b/gcc/testsuite/gcc.dg/pr99122-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -g -w" } */
+/* { dg-options "-std=gnu17 -O2 -g -w" } */
 
 static int foo ();
 
diff --git a/gcc/testsuite/gcc.dg/qual-component-1.c b/gcc/testsuite/gcc.dg/qual-component-1.c
index 4eaa71a2d19..f2043ce5144 100644
--- a/gcc/testsuite/gcc.dg/qual-component-1.c
+++ b/gcc/testsuite/gcc.dg/qual-component-1.c
@@ -3,7 +3,7 @@
    union.  Bug 27697 from Frank Victor Fischer.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "-pedantic -Wdiscarded-array-qualifiers" } */
+/* { dg-options "-std=gnu17 -pedantic -Wdiscarded-array-qualifiers" } */
 
 struct s {
   int a;
diff --git a/gcc/testsuite/gcc.dg/sibcall-6.c b/gcc/testsuite/gcc.dg/sibcall-6.c
index 8ee72cac444..c8830b665e9 100644
--- a/gcc/testsuite/gcc.dg/sibcall-6.c
+++ b/gcc/testsuite/gcc.dg/sibcall-6.c
@@ -8,7 +8,7 @@
 
 /* { dg-do run { target epiphany-*-* i?86-*-* x86_64-*-* s390*-*-* } } */
 /* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && { ia32 && { ! nonpic } } } } */
-/* { dg-options "-O2 -foptimize-sibling-calls -fno-ipa-cp" } */
+/* { dg-options "-Wno-old-style-definition -O2 -foptimize-sibling-calls -fno-ipa-cp" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.dg/sms-2.c b/gcc/testsuite/gcc.dg/sms-2.c
index f8375f9f05d..61723141d96 100644
--- a/gcc/testsuite/gcc.dg/sms-2.c
+++ b/gcc/testsuite/gcc.dg/sms-2.c
@@ -2,7 +2,7 @@
    traversal of the loops after versioning.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fmodulo-sched -fdump-rtl-sms" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fmodulo-sched -fdump-rtl-sms" } */
 
 int th, h, em, nlwm, nlwS, nlw, sy;
 void
diff --git a/gcc/testsuite/gcc.dg/tm/20091221.c b/gcc/testsuite/gcc.dg/tm/20091221.c
index 7837243fe5c..655e55cfb24 100644
--- a/gcc/testsuite/gcc.dg/tm/20091221.c
+++ b/gcc/testsuite/gcc.dg/tm/20091221.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fgnu-tm -fdump-tree-tmedge" } */
+/* { dg-options "-std=gnu17 -fgnu-tm -fdump-tree-tmedge" } */
 
 int i;
 extern void virgin () __attribute__((transaction_pure));
diff --git a/gcc/testsuite/gcc.dg/torture/bfloat16-basic.c b/gcc/testsuite/gcc.dg/torture/bfloat16-basic.c
index 09e54d4470a..20ce60eb7af 100644
--- a/gcc/testsuite/gcc.dg/torture/bfloat16-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/bfloat16-basic.c
@@ -1,6 +1,6 @@
 /* Test __bf16.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options bfloat16 } */
 /* { dg-require-effective-target bfloat16_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float128-basic.c b/gcc/testsuite/gcc.dg/torture/float128-basic.c
index b23d45bf72b..24a22b0eb15 100644
--- a/gcc/testsuite/gcc.dg/torture/float128-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float128-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float128.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float128 } */
 /* { dg-require-effective-target float128_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float128x-basic.c b/gcc/testsuite/gcc.dg/torture/float128x-basic.c
index 75c5a28bb9d..ea80990a617 100644
--- a/gcc/testsuite/gcc.dg/torture/float128x-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float128x-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float128x.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float128x } */
 /* { dg-require-effective-target float128x_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float16-basic.c b/gcc/testsuite/gcc.dg/torture/float16-basic.c
index e94aa203d40..adcbdf936b5 100644
--- a/gcc/testsuite/gcc.dg/torture/float16-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float16-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float16.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float16 } */
 /* { dg-require-effective-target float16_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float32-basic.c b/gcc/testsuite/gcc.dg/torture/float32-basic.c
index 2d3e7a96175..e6b2785bdef 100644
--- a/gcc/testsuite/gcc.dg/torture/float32-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float32-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float32.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float32 } */
 /* { dg-require-effective-target float32_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float32x-basic.c b/gcc/testsuite/gcc.dg/torture/float32x-basic.c
index f2abc332488..b4ca33f6375 100644
--- a/gcc/testsuite/gcc.dg/torture/float32x-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float32x-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float32x.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float32x } */
 /* { dg-require-effective-target float32x_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float64-basic.c b/gcc/testsuite/gcc.dg/torture/float64-basic.c
index decb05f34b2..7e644c31718 100644
--- a/gcc/testsuite/gcc.dg/torture/float64-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float64-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float64.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float64 } */
 /* { dg-require-effective-target float64_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float64x-basic.c b/gcc/testsuite/gcc.dg/torture/float64x-basic.c
index 7a140af0bd7..90dac84bf0b 100644
--- a/gcc/testsuite/gcc.dg/torture/float64x-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float64x-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float64x.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float64x } */
 /* { dg-require-effective-target float64x_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr102762.c b/gcc/testsuite/gcc.dg/torture/pr102762.c
index 67c6b00ccea..d52a970ae39 100644
--- a/gcc/testsuite/gcc.dg/torture/pr102762.c
+++ b/gcc/testsuite/gcc.dg/torture/pr102762.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* We fail to diagnose the invalid __builtin_va_arg_pack use with -flto.  */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr103987.c b/gcc/testsuite/gcc.dg/torture/pr103987.c
index 6bfc76881a1..6fc2eff72ea 100644
--- a/gcc/testsuite/gcc.dg/torture/pr103987.c
+++ b/gcc/testsuite/gcc.dg/torture/pr103987.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 void foo();
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr104825.c b/gcc/testsuite/gcc.dg/torture/pr104825.c
index 7affacc2094..417012e5fdd 100644
--- a/gcc/testsuite/gcc.dg/torture/pr104825.c
+++ b/gcc/testsuite/gcc.dg/torture/pr104825.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-additional-options "-Wno-stringop-overread" } */
+/* { dg-additional-options "-Wno-old-style-definition -Wno-stringop-overread" } */
 
 int foo (fmt)
 char* fmt;
diff --git a/gcc/testsuite/gcc.dg/torture/pr105166.c b/gcc/testsuite/gcc.dg/torture/pr105166.c
index 60e8b73a466..745af50e662 100644
--- a/gcc/testsuite/gcc.dg/torture/pr105166.c
+++ b/gcc/testsuite/gcc.dg/torture/pr105166.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 int bar (foo, a)
   int (**foo) ();
diff --git a/gcc/testsuite/gcc.dg/torture/pr105185.c b/gcc/testsuite/gcc.dg/torture/pr105185.c
index 6ab32360de1..88dee57c5c4 100644
--- a/gcc/testsuite/gcc.dg/torture/pr105185.c
+++ b/gcc/testsuite/gcc.dg/torture/pr105185.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 int foo (fmt)
 char* fmt;
diff --git a/gcc/testsuite/gcc.dg/torture/pr109652.c b/gcc/testsuite/gcc.dg/torture/pr109652.c
index 8a6524d2212..b3d5de9c61e 100644
--- a/gcc/testsuite/gcc.dg/torture/pr109652.c
+++ b/gcc/testsuite/gcc.dg/torture/pr109652.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 typedef int UInt;
 UInt skeletal_RI5_instr;
diff --git a/gcc/testsuite/gcc.dg/torture/pr112444.c b/gcc/testsuite/gcc.dg/torture/pr112444.c
index 61c7ec9b22e..769df6ae6ac 100644
--- a/gcc/testsuite/gcc.dg/torture/pr112444.c
+++ b/gcc/testsuite/gcc.dg/torture/pr112444.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-additional-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-additional-options "-std=gnu17 -ftrivial-auto-var-init=zero" } */
 
 int qmi_message_pbm_get_all_capabilities_output_capability_basic_information_get_printable_message_offset,
     qmi_message_pbm_get_all_capabilities_output_capability_basic_information_get_printable_message_init_offset,
diff --git a/gcc/testsuite/gcc.dg/torture/pr113895-3.c b/gcc/testsuite/gcc.dg/torture/pr113895-3.c
index 255975f3353..d8760e7de54 100644
--- a/gcc/testsuite/gcc.dg/torture/pr113895-3.c
+++ b/gcc/testsuite/gcc.dg/torture/pr113895-3.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 extern void f();
 char a[1][1], b;
diff --git a/gcc/testsuite/gcc.dg/torture/pr24626-2.c b/gcc/testsuite/gcc.dg/torture/pr24626-2.c
index 541c8c5aca4..c6d15ea8a3f 100644
--- a/gcc/testsuite/gcc.dg/torture/pr24626-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr24626-2.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
diff --git a/gcc/testsuite/gcc.dg/torture/pr25183.c b/gcc/testsuite/gcc.dg/torture/pr25183.c
index 84b4c8f8d44..22af72b8dd0 100644
--- a/gcc/testsuite/gcc.dg/torture/pr25183.c
+++ b/gcc/testsuite/gcc.dg/torture/pr25183.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
 enum err {
   err_IO = 0x8a450000, /* { dg-warning "int" } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr38948.c b/gcc/testsuite/gcc.dg/torture/pr38948.c
index 22cef3b356d..01b7213e90f 100644
--- a/gcc/testsuite/gcc.dg/torture/pr38948.c
+++ b/gcc/testsuite/gcc.dg/torture/pr38948.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fno-tree-sra" } */
+/* { dg-options "-std=gnu17 -fno-tree-sra" } */
 typedef unsigned char byte;
 typedef unsigned int uint;
 typedef int bool;
diff --git a/gcc/testsuite/gcc.dg/torture/pr44807.c b/gcc/testsuite/gcc.dg/torture/pr44807.c
index 918333e2563..2230db65410 100644
--- a/gcc/testsuite/gcc.dg/torture/pr44807.c
+++ b/gcc/testsuite/gcc.dg/torture/pr44807.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 int sigemptyset (int *);
 int sigaddset(int, int);
diff --git a/gcc/testsuite/gcc.dg/torture/pr47281.c b/gcc/testsuite/gcc.dg/torture/pr47281.c
index 517e8548e3f..752b472c93e 100644
--- a/gcc/testsuite/gcc.dg/torture/pr47281.c
+++ b/gcc/testsuite/gcc.dg/torture/pr47281.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 struct T;
 typedef void F(void);
diff --git a/gcc/testsuite/gcc.dg/torture/pr47958-1.c b/gcc/testsuite/gcc.dg/torture/pr47958-1.c
index 9fdf142fc99..14feffb9ff9 100644
--- a/gcc/testsuite/gcc.dg/torture/pr47958-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr47958-1.c
@@ -1,4 +1,5 @@
 /* { dg-do assemble } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 void (*foo[6][6]) (int);
 void bar (hdR)
diff --git a/gcc/testsuite/gcc.dg/torture/pr48063.c b/gcc/testsuite/gcc.dg/torture/pr48063.c
index d861bf04c80..ff6960f089c 100644
--- a/gcc/testsuite/gcc.dg/torture/pr48063.c
+++ b/gcc/testsuite/gcc.dg/torture/pr48063.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/48063 */
 /* { dg-do compile } */
-/* { dg-options "-fno-early-inlining" } */
+/* { dg-options "-std=gnu17 -fno-early-inlining" } */
 
 extern void abort (void);
 static void bar ();
diff --git a/gcc/testsuite/gcc.dg/torture/pr57036-1.c b/gcc/testsuite/gcc.dg/torture/pr57036-1.c
index ac6bc6b9df2..b1cddb10349 100644
--- a/gcc/testsuite/gcc.dg/torture/pr57036-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr57036-1.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 extern void g (void);
 int _setjmp();
diff --git a/gcc/testsuite/gcc.dg/torture/pr57330.c b/gcc/testsuite/gcc.dg/torture/pr57330.c
index 3e6cbcbd28c..362622c6a64 100644
--- a/gcc/testsuite/gcc.dg/torture/pr57330.c
+++ b/gcc/testsuite/gcc.dg/torture/pr57330.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 void foo (int a)
 {}
diff --git a/gcc/testsuite/gcc.dg/torture/pr57584.c b/gcc/testsuite/gcc.dg/torture/pr57584.c
index e4affb2e461..475dabe9a43 100644
--- a/gcc/testsuite/gcc.dg/torture/pr57584.c
+++ b/gcc/testsuite/gcc.dg/torture/pr57584.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target int32plus } */
 /* { dg-require-effective-target label_values } */
 /* { dg-require-effective-target indirect_jumps } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr67741.c b/gcc/testsuite/gcc.dg/torture/pr67741.c
index c0019d04a86..d1a8c251fd7 100644
--- a/gcc/testsuite/gcc.dg/torture/pr67741.c
+++ b/gcc/testsuite/gcc.dg/torture/pr67741.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 struct singlecomplex { float real, imag ; } ;
 struct doublecomplex { double real, imag ; } ;
diff --git a/gcc/testsuite/gcc.dg/torture/pr68104.c b/gcc/testsuite/gcc.dg/torture/pr68104.c
index 5db0282cdc7..8743ecf52bd 100644
--- a/gcc/testsuite/gcc.dg/torture/pr68104.c
+++ b/gcc/testsuite/gcc.dg/torture/pr68104.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 typedef struct
 {
diff --git a/gcc/testsuite/gcc.dg/torture/pr69242.c b/gcc/testsuite/gcc.dg/torture/pr69242.c
index d7f171810b9..2a50a167d1a 100644
--- a/gcc/testsuite/gcc.dg/torture/pr69242.c
+++ b/gcc/testsuite/gcc.dg/torture/pr69242.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-additional-options "-w" } */
+/* { dg-additional-options "-std=gnu17 -w" } */
 
 int a[1];
 void *memcpy();
diff --git a/gcc/testsuite/gcc.dg/torture/pr70457.c b/gcc/testsuite/gcc.dg/torture/pr70457.c
index 74daed4d36f..e0a212f1dbc 100644
--- a/gcc/testsuite/gcc.dg/torture/pr70457.c
+++ b/gcc/testsuite/gcc.dg/torture/pr70457.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 /* This formerly ICEd when trying to expand pow as a built-in with
    the wrong number of arguments.  */
diff --git a/gcc/testsuite/gcc.dg/torture/pr70985.c b/gcc/testsuite/gcc.dg/torture/pr70985.c
index 17273b029a4..36544934850 100644
--- a/gcc/testsuite/gcc.dg/torture/pr70985.c
+++ b/gcc/testsuite/gcc.dg/torture/pr70985.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target int32plus } */
 
 struct
diff --git a/gcc/testsuite/gcc.dg/torture/pr71606.c b/gcc/testsuite/gcc.dg/torture/pr71606.c
index b0cc26ac771..ec7a1102b30 100644
--- a/gcc/testsuite/gcc.dg/torture/pr71606.c
+++ b/gcc/testsuite/gcc.dg/torture/pr71606.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 _Complex a;
 void fn1 ();
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr71816.c b/gcc/testsuite/gcc.dg/torture/pr71816.c
index cc143fa6c7d..5db86b9c104 100644
--- a/gcc/testsuite/gcc.dg/torture/pr71816.c
+++ b/gcc/testsuite/gcc.dg/torture/pr71816.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-prune-output "\\\[-Wbuiltin-declaration-mismatch" } */
 
 void *ext2fs_resize_mem_p;
diff --git a/gcc/testsuite/gcc.dg/torture/pr77286.c b/gcc/testsuite/gcc.dg/torture/pr77286.c
index 0c0610050f1..29d96eb7600 100644
--- a/gcc/testsuite/gcc.dg/torture/pr77286.c
+++ b/gcc/testsuite/gcc.dg/torture/pr77286.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-additional-options "-mavx2" { target x86_64-*-* i?86-*-* } } */
 
 typedef float real;
diff --git a/gcc/testsuite/gcc.dg/torture/pr77646.c b/gcc/testsuite/gcc.dg/torture/pr77646.c
index 1b1990037bf..6366c1be7eb 100644
--- a/gcc/testsuite/gcc.dg/torture/pr77646.c
+++ b/gcc/testsuite/gcc.dg/torture/pr77646.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 struct e {
     int (*f)();
diff --git a/gcc/testsuite/gcc.dg/torture/pr77677-2.c b/gcc/testsuite/gcc.dg/torture/pr77677-2.c
index 768ab12601c..4ba25f0c6fa 100644
--- a/gcc/testsuite/gcc.dg/torture/pr77677-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr77677-2.c
@@ -1,6 +1,6 @@
 /* PR ipa/77677 */
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -w" } */
+/* { dg-options "-std=gnu17 -fpermissive -w" } */
 
 enum machine_mode { MAX_MACHINE_MODE };
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr78365.c b/gcc/testsuite/gcc.dg/torture/pr78365.c
index 5180a0171ae..2588a4826fd 100644
--- a/gcc/testsuite/gcc.dg/torture/pr78365.c
+++ b/gcc/testsuite/gcc.dg/torture/pr78365.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 int a, b, c;
 char d;
diff --git a/gcc/testsuite/gcc.dg/torture/pr79732.c b/gcc/testsuite/gcc.dg/torture/pr79732.c
index ed2695bf267..cfa337cf7a5 100644
--- a/gcc/testsuite/gcc.dg/torture/pr79732.c
+++ b/gcc/testsuite/gcc.dg/torture/pr79732.c
@@ -1,4 +1,5 @@
 /* { dg-do link } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-alias "" } */
 
 int bar () __attribute__ ((alias ("foo")));
diff --git a/gcc/testsuite/gcc.dg/torture/pr80612.c b/gcc/testsuite/gcc.dg/torture/pr80612.c
index e648e82559c..d3f82d306b7 100644
--- a/gcc/testsuite/gcc.dg/torture/pr80612.c
+++ b/gcc/testsuite/gcc.dg/torture/pr80612.c
@@ -1,5 +1,6 @@
 /* PR tree-optimization/80612 */
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 struct obstack *a;
 struct obstack {
diff --git a/gcc/testsuite/gcc.dg/torture/pr80764.c b/gcc/testsuite/gcc.dg/torture/pr80764.c
index bc6d8e87ac3..c8e5655990c 100644
--- a/gcc/testsuite/gcc.dg/torture/pr80764.c
+++ b/gcc/testsuite/gcc.dg/torture/pr80764.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 int b, d, f, h;
 char e;
diff --git a/gcc/testsuite/gcc.dg/torture/pr80842.c b/gcc/testsuite/gcc.dg/torture/pr80842.c
index 600e8ce13ae..2fc4059a109 100644
--- a/gcc/testsuite/gcc.dg/torture/pr80842.c
+++ b/gcc/testsuite/gcc.dg/torture/pr80842.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 unsigned a;
 short b;
diff --git a/gcc/testsuite/gcc.dg/torture/pr81900.c b/gcc/testsuite/gcc.dg/torture/pr81900.c
index 9e4e8f4a7ca..2936f1de4a8 100644
--- a/gcc/testsuite/gcc.dg/torture/pr81900.c
+++ b/gcc/testsuite/gcc.dg/torture/pr81900.c
@@ -1,7 +1,7 @@
 /* PR/81900 */
 /* { dg-do compile } */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
-/* { dg-options "-fdump-tree-optimized" } */
+/* { dg-options "-std=gnu17 -fdump-tree-optimized" } */
 
 void Perl_croak() __attribute__((noreturn));
 char *Perl_sv_gets();
diff --git a/gcc/testsuite/gcc.dg/torture/pr82276.c b/gcc/testsuite/gcc.dg/torture/pr82276.c
index 2f9efc8b914..fc9f2c5a078 100644
--- a/gcc/testsuite/gcc.dg/torture/pr82276.c
+++ b/gcc/testsuite/gcc.dg/torture/pr82276.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 typedef struct a {
   struct a *b;
diff --git a/gcc/testsuite/gcc.dg/torture/pr84803.c b/gcc/testsuite/gcc.dg/torture/pr84803.c
index 81aad626d6c..e9f3783212a 100644
--- a/gcc/testsuite/gcc.dg/torture/pr84803.c
+++ b/gcc/testsuite/gcc.dg/torture/pr84803.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 long a;
 long *b;
diff --git a/gcc/testsuite/gcc.dg/torture/pr93124.c b/gcc/testsuite/gcc.dg/torture/pr93124.c
index 0d361d8c7cf..e654ab83309 100644
--- a/gcc/testsuite/gcc.dg/torture/pr93124.c
+++ b/gcc/testsuite/gcc.dg/torture/pr93124.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-fno-rerun-cse-after-loop -fno-guess-branch-probability -fno-tree-fre" } */
+/* { dg-additional-options "-std=gnu17 -fno-rerun-cse-after-loop -fno-guess-branch-probability -fno-tree-fre" } */
 /* { dg-require-effective-target alloca } */
 
 int x;
diff --git a/gcc/testsuite/gcc.dg/torture/pr97330-1.c b/gcc/testsuite/gcc.dg/torture/pr97330-1.c
index 7dce5bd90d4..8bd20371388 100644
--- a/gcc/testsuite/gcc.dg/torture/pr97330-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr97330-1.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 typedef int a;
 typedef char b;
diff --git a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
index baed1e3fa78..322ebf7f7ba 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
@@ -1,6 +1,6 @@
 /* { dg-require-effective-target freorder } */
 /* { dg-require-effective-target label_values } */
-/* { dg-options "-O2 -freorder-blocks-and-partition" } */
+/* { dg-options "-std=gnu17 -O2 -freorder-blocks-and-partition" } */
 /* { dg-require-stack-size "4000" } */
 
 #include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
index ce50af26a7c..9fa3a88408a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
index 8b7ab985bd3..9910c7902d7 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
 extern void abort (void);
 struct rtx_def;
 typedef struct rtx_def *rtx;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
index 78938f919d4..e228400c97b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O -fdump-tree-dce3" } */
+/* { dg-options "-Wno-old-style-definition -O -fdump-tree-dce3" } */
   
 struct rtx_def;
 typedef struct rtx_def *rtx;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
index 838317de293..2c9920ae039 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
   
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
index 529c79b26e3..11391e6ee6a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-copyprop2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-copyprop2" } */
 
 extern void abort (void);
 extern void blah (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
index 080ccfa8382..c3f75eff29e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
  
 extern void abort (void);
 extern void blah (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
index 7fce5ab4b66..6f3c8c303b7 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-dom2" } */
   
 
 struct rtx_def;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
index 15d7e973041..f5b0a14837e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
   
 
 struct rtx_def;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
index 9f0daac22dc..ad1b8ad791b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
    
 struct rtx_def;
 typedef struct rtx_def *rtx;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
index 9585ff11307..a3b564da368 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
    
 
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
index 7c1fea7dfbb..10ed817d570 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-rtl-expand-details" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-rtl-expand-details" } */
     
 
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c
index 0e01e511b78..939dbaec2ea 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-vrp1" } */
      
 
 extern const unsigned char mode_size[];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
index 6effbb7ffe5..e7e73cb4502 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
 
 extern void abort (void);
 struct rtx_def;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
index bba3569c76f..1097798158a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
                                                                                 
 typedef unsigned int cppchar_t;
 void foo (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c
index e680de8bdee..1453df6eeb0 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-vrp1" } */
      
 
 void
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
index ca06f712890..857191de16e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-vrp1" } */
   
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
index e59b3e346c2..53a2d01763a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
     
 extern void abort (void);
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
index 1b0bef1d3e0..986540ca1bc 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
     
 extern void abort (void);
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
index e4b8d43d299..d147dff6f08 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fno-tree-fre -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fno-tree-fre -fdump-tree-dom2" } */
 
 extern void abort (void);
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
index 719ea65f5bf..271f0a5760f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
@@ -2,7 +2,7 @@
    references after propagating &equot[0] into p.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O -ftree-dominator-opts" } */
+/* { dg-options "-Wno-old-style-definition -O -ftree-dominator-opts" } */
 
 static unsigned short equot[(6 +3)];
 int
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c
index 11f76671604..5ec48e3da95 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-phiopt1" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-phiopt1" } */
 int
 foo2 (distance, i, j)
      int distance;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c
index 52903dde497..746100836f3 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */ 
-/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-pre-stats" } */
 /* We can't eliminate the *p load here in any sane way, as eshup8 may 
    change it.  */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr111003.c b/gcc/testsuite/gcc.dg/tree-ssa/pr111003.c
index a520765dd9f..59d3a966662 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr111003.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr111003.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-optimized" } */
+/* { dg-options "-std=gnu17 -O3 -fdump-tree-optimized" } */
 
 static int c, d, e, f;
 static short g;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c b/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c
index 14bd4dbd6e5..278843019b2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -w" } */
+/* { dg-options "-std=gnu17 -O3 -w" } */
 
 long XXH3_len_4to8_64b_len, XXH3_len_0to16_64b___trans_tmp_3, XXH3_mix2Accs_acc,
     XXH3_64bits_internal___trans_tmp_8;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr115191.c b/gcc/testsuite/gcc.dg/tree-ssa/pr115191.c
index 43f780aa3b8..fe0c1321883 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr115191.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr115191.c
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-O1 -w" }
+// { dg-options "-std=gnu17 -O1 -w" }
 
 typedef void *SCM;
 void set_socket_io_ports();
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c b/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c
index 0ce9ed3a620..b749151d503 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 typedef struct
 {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr69666.c b/gcc/testsuite/gcc.dg/tree-ssa/pr69666.c
index 9be77ea1523..220c0cde15b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr69666.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr69666.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -w" } */
+/* { dg-options "-std=gnu17 -O2 -w" } */
 
 int a, c, d;
 float b;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c b/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c
index d636672fddc..6873f87bcce 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -w -fdump-tree-vrp1-details -fdump-tree-vrp2-details -fdump-tree-dom2-details -fdump-tree-dom3-details" } */
+/* { dg-options "-std=gnu17 -O2 -w -fdump-tree-vrp1-details -fdump-tree-vrp2-details -fdump-tree-dom2-details -fdump-tree-dom3-details" } */
 
 /* All the threads found by the threader should have too many
    statements to be profitable.  */
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr79757-1.c b/gcc/testsuite/gcc.dg/ubsan/pr79757-1.c
index ca074bcff46..20ed2cdb93f 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr79757-1.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr79757-1.c
@@ -1,7 +1,7 @@
 /* PR sanitizer/79757 */
 /* { dg-do compile } */
 /* { dg-require-effective-target int128 } */
-/* { dg-options "-fsanitize=undefined" } */
+/* { dg-options "-Wno-old-style-definition -fsanitize=undefined" } */
 
 unsigned __int128 x, y;
 
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr79757-2.c b/gcc/testsuite/gcc.dg/ubsan/pr79757-2.c
index b3e1939a547..32e38c11ef0 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr79757-2.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr79757-2.c
@@ -1,7 +1,7 @@
 /* PR sanitizer/79757 */
 /* { dg-do compile } */
 /* { dg-require-effective-target int128 } */
-/* { dg-options "-fsanitize=undefined" } */
+/* { dg-options "-Wno-old-style-definition -fsanitize=undefined" } */
 
 unsigned __int128 x, y;
 
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr79757-3.c b/gcc/testsuite/gcc.dg/ubsan/pr79757-3.c
index 22fe3deef2d..7eb3fee54ce 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr79757-3.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr79757-3.c
@@ -1,7 +1,7 @@
 /* PR sanitizer/79757 */
 /* { dg-do compile } */
 /* { dg-require-effective-target int128 } */
-/* { dg-options "-fsanitize=undefined" } */
+/* { dg-options "-Wno-old-style-definition -fsanitize=undefined" } */
 
 unsigned __int128 x, y;
 
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr81223.c b/gcc/testsuite/gcc.dg/ubsan/pr81223.c
index e7aff5243e6..f72b1cda809 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr81223.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr81223.c
@@ -1,6 +1,6 @@
 /* PR sanitizer/81223 */
 /* { dg-do compile } */
-/* { dg-options "-fsanitize=undefined" } */
+/* { dg-options "-std=gnu17 -fsanitize=undefined" } */
 
 void bar ();
 
diff --git a/gcc/testsuite/gcc.dg/uninit-10-O0.c b/gcc/testsuite/gcc.dg/uninit-10-O0.c
index f761ac91c41..18fe56cd26c 100644
--- a/gcc/testsuite/gcc.dg/uninit-10-O0.c
+++ b/gcc/testsuite/gcc.dg/uninit-10-O0.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Wall" } */
+/* { dg-options "-Wno-old-style-definition -Wall" } */
 /* On Alpha EV4, dead code elimination and cfg simplification conspired
    to leave the register containing 'C' marked live, though all references
    to the variable had been removed.  */
diff --git a/gcc/testsuite/gcc.dg/uninit-10.c b/gcc/testsuite/gcc.dg/uninit-10.c
index 0d62020df9f..e2396a5e18a 100644
--- a/gcc/testsuite/gcc.dg/uninit-10.c
+++ b/gcc/testsuite/gcc.dg/uninit-10.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wall" } */
+/* { dg-options "-Wno-old-style-definition -O2 -Wall" } */
 /* On Alpha EV4, dead code elimination and cfg simplification conspired
    to leave the register containing 'C' marked live, though all references
    to the variable had been removed.  */
diff --git a/gcc/testsuite/gcc.dg/uninit-32.c b/gcc/testsuite/gcc.dg/uninit-32.c
index cf9efa0f064..586b6355f43 100644
--- a/gcc/testsuite/gcc.dg/uninit-32.c
+++ b/gcc/testsuite/gcc.dg/uninit-32.c
@@ -1,7 +1,7 @@
 /* PR middle-end/10138 - warn for uninitialized arrays passed as const*
    arguments
    { dg-do compile }
-   { dg-options "-O -Wall" }
+   { dg-options "-std=gnu17 -O -Wall" }
    { dg-require-effective-target alloca } */
 
 typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/uninit-41.c b/gcc/testsuite/gcc.dg/uninit-41.c
index f2e17a81d09..2f138cb8e5c 100644
--- a/gcc/testsuite/gcc.dg/uninit-41.c
+++ b/gcc/testsuite/gcc.dg/uninit-41.c
@@ -1,7 +1,7 @@
 /* Verify that calls to non-modifying built-ins aren't considered
    potentially modifying.
    { dg-do compile }
-   { dg-options "-O2 -Wall" }
+   { dg-options "-std=gnu17 -O2 -Wall" }
    { dg-require-effective-target alloca } */
 
 typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/uninit-A-O0.c b/gcc/testsuite/gcc.dg/uninit-A-O0.c
index 69376911563..c1f1a1cd6c7 100644
--- a/gcc/testsuite/gcc.dg/uninit-A-O0.c
+++ b/gcc/testsuite/gcc.dg/uninit-A-O0.c
@@ -2,7 +2,7 @@
    May be a real bug in CSE. */
 
 /* { dg-do compile } */
-/* { dg-options "-Wall" } */
+/* { dg-options "-Wno-old-style-definition -Wall" } */
 
 struct tree
 {
diff --git a/gcc/testsuite/gcc.dg/uninit-A.c b/gcc/testsuite/gcc.dg/uninit-A.c
index 28f7fe9fcf4..2adc374fbed 100644
--- a/gcc/testsuite/gcc.dg/uninit-A.c
+++ b/gcc/testsuite/gcc.dg/uninit-A.c
@@ -2,7 +2,7 @@
    May be a real bug in CSE. */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wall" } */
+/* { dg-options "-O2 -Wall -Wno-old-style-definition" } */
 
 struct tree
 {
diff --git a/gcc/testsuite/gcc.dg/unused-1.c b/gcc/testsuite/gcc.dg/unused-1.c
index 8db7c2ccfff..2cc86c04faa 100644
--- a/gcc/testsuite/gcc.dg/unused-1.c
+++ b/gcc/testsuite/gcc.dg/unused-1.c
@@ -2,7 +2,7 @@
    egcs-1.1.2 fails, egcs-ss-19990418 passes.
    http://gcc.gnu.org/ml/gcc-bugs/1998-09/msg00199.html */
 /* { dg-do compile } */
-/* { dg-options "-O -Wall -W" } */
+/* { dg-options "-Wno-old-style-definition -O -Wall -W" } */
 int
 f(c)
      char c; /* { dg-warning "unused parameter" "unused parameter warning" } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr114249.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr114249.c
index 64c93cd9a2d..36ccb2c0e94 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pr114249.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr114249.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 enum { SEG_THIN_POOL } read_only;
 struct {
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr97486.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr97486.c
index 17d48a7fe69..fceb93367b6 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pr97486.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr97486.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 struct {
   int *end_info;
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-1.c b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-1.c
index bea3b92ba77..dd3f91be4d2 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-1.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-1.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target vect_int } */
 /* PR tree-optimization/67682.  */
 
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c
index 9431bcb9d5c..2ee50039af3 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target vect_int } */
 /* { dg-require-effective-target vect_perm } */
 /* PR tree-optimization/67682.  */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-3.c b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-3.c
index d1d79125731..1b3d5d99eca 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-3.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-3.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target vect_int } */
 /* { dg-require-effective-target vect_int_mult } */
 /* PR tree-optimization/67682.  */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_111-pr113731.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_111-pr113731.c
index b205f470660..05edf59bec8 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_111-pr113731.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_111-pr113731.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
 /* { dg-require-effective-target vect_long } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_122-pr114239.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_122-pr114239.c
index 7bf4db14209..eea47f73e94 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_122-pr114239.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_122-pr114239.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
 
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c b/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c
index 033c3587f1b..d914b88d731 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c
@@ -6,6 +6,7 @@
    increment by 2 integers at a time, hence the last load needs s[30-33] and
    the penultimate load needs s[28-31].
    This testcase ensures that we do not crash due to that behaviour.  */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target mmap } */
 #include <sys/mman.h>
 #include <stdio.h>
diff --git a/gcc/testsuite/gcc.dg/vla-stexp-2.c b/gcc/testsuite/gcc.dg/vla-stexp-2.c
index 9f1512567f0..8616ef75d09 100644
--- a/gcc/testsuite/gcc.dg/vla-stexp-2.c
+++ b/gcc/testsuite/gcc.dg/vla-stexp-2.c
@@ -1,6 +1,6 @@
 /* PR101838 */
 /* { dg-do run } */
-/* { dg-options "-Wpedantic -O0" } */
+/* { dg-options "-std=gnu17 -Wpedantic -O0" } */
 /* { dg-require-effective-target alloca } */
 
 
diff --git a/gcc/testsuite/gcc.dg/warn-1.c b/gcc/testsuite/gcc.dg/warn-1.c
index 6db4ae5cd6c..d5acca2b9ae 100644
--- a/gcc/testsuite/gcc.dg/warn-1.c
+++ b/gcc/testsuite/gcc.dg/warn-1.c
@@ -1,7 +1,7 @@
 /* The compiler used to say passing arg 0 of, which is wrong.  */
 /* Radar 3069179 */
 
-/* { dg-options "-O3" } */
+/* { dg-options "-Wno-old-style-definition -O3" } */
 
 static void foo (p)
      int p;
diff --git a/gcc/testsuite/gcc.dg/winline-10.c b/gcc/testsuite/gcc.dg/winline-10.c
index 2df5addaebc..f4d92fae8c5 100644
--- a/gcc/testsuite/gcc.dg/winline-10.c
+++ b/gcc/testsuite/gcc.dg/winline-10.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -Winline -fopt-info-optimized-inline=stderr" } */
+/* { dg-options "-Wno-old-style-definition -O2 -Winline -fopt-info-optimized-inline=stderr" } */
 
 struct s { int a; };
 
diff --git a/gcc/testsuite/gcc.dg/wtr-label-1.c b/gcc/testsuite/gcc.dg/wtr-label-1.c
index 78a4d6b0a4b..bd31d925b77 100644
--- a/gcc/testsuite/gcc.dg/wtr-label-1.c
+++ b/gcc/testsuite/gcc.dg/wtr-label-1.c
@@ -2,7 +2,7 @@
    Note, gcc should omit these warnings in system header files.
    Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/24/2000.  */
 /* { dg-do compile } */
-/* { dg-options "-Wtraditional" } */
+/* { dg-options "-Wno-old-style-definition -Wtraditional" } */
 
 enum foo1 { a };
 struct foo2 { int i; };
diff --git a/gcc/testsuite/gcc.dg/wtr-switch-1.c b/gcc/testsuite/gcc.dg/wtr-switch-1.c
index f0381bc5e37..56913ea11a9 100644
--- a/gcc/testsuite/gcc.dg/wtr-switch-1.c
+++ b/gcc/testsuite/gcc.dg/wtr-switch-1.c
@@ -2,7 +2,7 @@
    Note, gcc should omit these warnings in system header files.
    By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000.  */
 /* { dg-do compile } */
-/* { dg-options "-Wtraditional" } */
+/* { dg-options "-Wno-old-style-definition -Wtraditional" } */
 
 void
 testfunc (l)
diff --git a/gcc/testsuite/gcc.target/i386/excess-precision-3.c b/gcc/testsuite/gcc.target/i386/excess-precision-3.c
index e8e9abc6957..06f24894160 100644
--- a/gcc/testsuite/gcc.target/i386/excess-precision-3.c
+++ b/gcc/testsuite/gcc.target/i386/excess-precision-3.c
@@ -1,7 +1,7 @@
 /* Excess precision tests.  Test excess precision is removed when
    necessary.  */
 /* { dg-do run } */
-/* { dg-options "-O2 -mfpmath=387 -fexcess-precision=standard" } */
+/* { dg-options "-Wno-old-style-definition -O2 -mfpmath=387 -fexcess-precision=standard" } */
 
 #include <float.h>
 #include <stdarg.h>
diff --git a/gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c b/gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c
index 385cd950b97..ef0cf41feaa 100644
--- a/gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c
+++ b/gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-require-effective-target fma4 } */
-/* { dg-options "-O2 -mfma4" } */
+/* { dg-options "-std=gnu17 -O2 -mfma4" } */
 
 #include "fma4-check.h"
 
diff --git a/gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c b/gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c
index c0bce417e11..82431ea4614 100644
--- a/gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c
+++ b/gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-require-effective-target fma4 } */
-/* { dg-options "-O0 -mfma4" } */
+/* { dg-options "-std=gnu17 -O0 -mfma4" } */
 
 #include "fma4-check.h"
 
diff --git a/gcc/testsuite/gcc.target/i386/nop-mcount.c b/gcc/testsuite/gcc.target/i386/nop-mcount.c
index a5f8d27fda4..ee3c97f3a57 100644
--- a/gcc/testsuite/gcc.target/i386/nop-mcount.c
+++ b/gcc/testsuite/gcc.target/i386/nop-mcount.c
@@ -1,7 +1,7 @@
 /* Test -mnop-mcount */
 /* { dg-do compile { target { *-*-linux* && nonpic } } } */
 /* { dg-require-effective-target mfentry } */
-/* { dg-options "-pg -mfentry -mrecord-mcount -mnop-mcount" } */
+/* { dg-options "-Wno-old-style-definition -pg -mfentry -mrecord-mcount -mnop-mcount" } */
 /* { dg-final { scan-assembler-not "__fentry__" } } */
 /* Origin: Andi Kleen */
 extern void foobar(char *);
diff --git a/gcc/testsuite/gcc.target/i386/pr102627.c b/gcc/testsuite/gcc.target/i386/pr102627.c
index 8ab9acaf002..7e140923644 100644
--- a/gcc/testsuite/gcc.target/i386/pr102627.c
+++ b/gcc/testsuite/gcc.target/i386/pr102627.c
@@ -1,6 +1,6 @@
 /* PR rtl-optimization/102627 */
 /* { dg-do run } */
-/* { dg-options "-O1" } */
+/* { dg-options "-std=gnu17 -O1" } */
 
 int a, f, l, m, q, c, d, g;
 long b, e;
diff --git a/gcc/testsuite/gcc.target/i386/pr106994.c b/gcc/testsuite/gcc.target/i386/pr106994.c
index 0803311dc75..b0bf9856d19 100644
--- a/gcc/testsuite/gcc.target/i386/pr106994.c
+++ b/gcc/testsuite/gcc.target/i386/pr106994.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-march=skylake -Ofast" } */
+/* { dg-options "-std=gnu17 -march=skylake -Ofast" } */
 
 typedef struct {
   float ymin, ymax;
diff --git a/gcc/testsuite/gcc.target/i386/pr68349.c b/gcc/testsuite/gcc.target/i386/pr68349.c
index 3c38c3a01f3..b8540e4948b 100644
--- a/gcc/testsuite/gcc.target/i386/pr68349.c
+++ b/gcc/testsuite/gcc.target/i386/pr68349.c
@@ -1,6 +1,6 @@
 /* PR target/68483 */
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 int a, b;
 unsigned long my_strlen();
diff --git a/gcc/testsuite/gcc.target/i386/pr97313.c b/gcc/testsuite/gcc.target/i386/pr97313.c
index 711766b4132..6167a1ff075 100644
--- a/gcc/testsuite/gcc.target/i386/pr97313.c
+++ b/gcc/testsuite/gcc.target/i386/pr97313.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fPIE" } */
+/* { dg-options "-std=gnu17 -O2 -fPIE" } */
 /* { dg-require-effective-target pie } */
 
 typedef struct {
diff --git a/gcc/testsuite/gcc.target/i386/pr99454.c b/gcc/testsuite/gcc.target/i386/pr99454.c
index ba3ffe2cab3..f46d56da0be 100644
--- a/gcc/testsuite/gcc.target/i386/pr99454.c
+++ b/gcc/testsuite/gcc.target/i386/pr99454.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O -w" } */
+/* { dg-options "-std=gnu17 -O -w" } */
 
 struct skb_shared_info {
   short gso_size;
diff --git a/gcc/testsuite/gcc.target/i386/record-mcount.c b/gcc/testsuite/gcc.target/i386/record-mcount.c
index 05b4bcba711..52924e0f214 100644
--- a/gcc/testsuite/gcc.target/i386/record-mcount.c
+++ b/gcc/testsuite/gcc.target/i386/record-mcount.c
@@ -1,6 +1,6 @@
 /* Test -mrecord-mcount */
 /* { dg-do compile { target { *-*-linux* && nonpic } } } */
-/* { dg-options "-pg -mrecord-mcount" } */
+/* { dg-options "-Wno-old-style-definition -pg -mrecord-mcount" } */
 /* { dg-final { scan-assembler "mcount_loc" } } */
 /* Origin: Andi Kleen */
 extern void foobar(char *);
diff --git a/libffi/testsuite/libffi.call/va_struct2.c b/libffi/testsuite/libffi.call/va_struct2.c
index 56f5b9c75fa..49359be712c 100644
--- a/libffi/testsuite/libffi.call/va_struct2.c
+++ b/libffi/testsuite/libffi.call/va_struct2.c
@@ -33,6 +33,7 @@ test_fn (int n, ...)
   struct small_tag s2;
   struct large_tag l;
 
+  (void) n;
   va_start (ap, n);
   s1 = va_arg (ap, struct small_tag);
   l = va_arg (ap, struct large_tag);
diff --git a/libffi/testsuite/libffi.call/va_struct3.c b/libffi/testsuite/libffi.call/va_struct3.c
index 9a27e7fd4a3..c30f9af8894 100644
--- a/libffi/testsuite/libffi.call/va_struct3.c
+++ b/libffi/testsuite/libffi.call/va_struct3.c
@@ -33,6 +33,7 @@ test_fn (int n, ...)
   struct small_tag s2;
   struct large_tag l;
 
+  (void) n;
   va_start (ap, n);
   s1 = va_arg (ap, struct small_tag);
   l = va_arg (ap, struct large_tag);
Jakub Jelinek Oct. 16, 2024, 12:28 p.m. UTC | #3
On Wed, Oct 16, 2024 at 12:21:49PM +0000, Joseph Myers wrote:
> On Wed, 16 Oct 2024, Jakub Jelinek wrote:
> 
> > Generally, I'd prefer dg-additional-options for tests
> > which don't already have dg-options into which one can just add the new
> > flag, or as in the above cases where a new flag is added only conditionally.
> > Just am not 100% sure if it works in lto tests...
> 
> Here is a version preferring dg-additional-options to avoid adding 
> dg-options where not present or where the number of dg-options lines would 
> have to increase because of conditionals.  OK to commit subject to testing 
> (including making sure the lto tests do get built with the given options)?

Yes, thanks.

	Jakub
Joseph Myers Oct. 16, 2024, 4:50 p.m. UTC | #4
On Wed, 16 Oct 2024, Jakub Jelinek wrote:

> On Wed, Oct 16, 2024 at 12:21:49PM +0000, Joseph Myers wrote:
> > On Wed, 16 Oct 2024, Jakub Jelinek wrote:
> > 
> > > Generally, I'd prefer dg-additional-options for tests
> > > which don't already have dg-options into which one can just add the new
> > > flag, or as in the above cases where a new flag is added only conditionally.
> > > Just am not 100% sure if it works in lto tests...
> > 
> > Here is a version preferring dg-additional-options to avoid adding 
> > dg-options where not present or where the number of dg-options lines would 
> > have to increase because of conditionals.  OK to commit subject to testing 
> > (including making sure the lto tests do get built with the given options)?
> 
> Yes, thanks.

It turns out that dg-additional-options didn't work in gcc.dg/lto so I've 
committed this version that uses dg-options for those two tests (having 
verified that it just adds -std=gnu17 for those two tests without 
affecting other options used to build them).


testsuite: Prepare for -std=gnu23 default

Now that C23 support is essentially feature-complete, I'd like to
switch the default language version for C compilation to -std=gnu23.

This requires updating a large number of testcases that fail with the
new language version if left unchanged.  In this patch, update most of
the tests for which there is a safe change that works both before and
after the update to default language version - typically adding the
option -std=gnu17 or -Wno-old-style-definition to the tests.  (There
are also a few tests where I'd like to investigate further why they
fail with -std=gnu23, or where I think such failures show an actual
bug to fix before changing the default language version, or where it
seems more appropriate to make a testcase change that would result in
failures in the absence of the language version change rather than
just adding an option that does nothing with the gnu17 default.)

The libffi test fixes have also been submitted upstream:
<https://github.com/libffi/libffi/pull/861>.

Most of the failures requiring such changes are for one of two
reasons:

* Unprototyped function declarations with () (meaning the same as
  (void) in C23 mode) for a function then called with arguments.

* Old-style function definitions, which warn by default in C23 mode,
  so resulting in test failures for the unexpected warnings.

Other reasons for failures include:

* Tests with their own definitions of bool, true and false.

* Tests of diagnostics (often with -pedantic) in cases where C23 has
  changed semantics, such as:

  - tag compatibility for structs;
  - enum values out of range of int;
  - handing of qualified array types;
  - decimal floating types formerly needing -pedantic diagnostics, but
    being standard in C23.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

gcc/testsuite/
	* c-c++-common/Wcast-function-type.c: Add -std=gnu17 for C.
	* c-c++-common/Wformat-pr84258.c: Add -std=gnu17 for C.
	* c-c++-common/Wvarargs.c: Add -std=gnu17 for C.
	* c-c++-common/analyzer/data-model-12.c: Add -std=gnu17 for C.
	* c-c++-common/builtins.c: Add -std=gnu17 for C.
	* c-c++-common/pointer-to-fn1.c: Add -std=gnu17 for C.
	* c-c++-common/pragma-diag-17.c: Add -std=gnu17 for C.
	* c-c++-common/sizeof-array-argument.c: Add
	-Wno-old-style-definition for C.
	* g++.dg/lto/pr54625-1_0.c: Add -std=gnu17.
	* g++.dg/lto/pr54625-2_0.c: Add -std=gnu17.
	* gcc.c-torture/compile/20040214-2.c: Add -std=gnu17.
	* gcc.c-torture/compile/921011-2.c: Add -std=gnu17.
	* gcc.c-torture/compile/931102-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/990801-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/nested-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr100241-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr106101.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr113616.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr47967.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr51694.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr71109.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr83051-2.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr89663-1.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr94238.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr96796.c: Add -std=gnu17.
	* gcc.c-torture/compile/pr97576.c: Add -std=gnu17.
	* gcc.c-torture/compile/udivmod4.c: Add -std=gnu17.
	* gcc.c-torture/execute/20010605-2.c: Add -std=gnu17.
	* gcc.c-torture/execute/20020404-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/20030714-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/20051012-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/20190820-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/920612-1.c: Add -Wno-old-style-definition.
	* gcc.c-torture/execute/930608-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/comp-goto-1.c: Add -std=gnu17.
	* gcc.c-torture/execute/ieee/fp-cmp-1.x: Add -std=gnu17.
	* gcc.c-torture/execute/ieee/fp-cmp-2.x: Add -std=gnu17.
	* gcc.c-torture/execute/ieee/fp-cmp-3.x: Add -std=gnu17.
	* gcc.c-torture/execute/ieee/fp-cmp-4.x: New file.
	* gcc.c-torture/execute/ieee/fp-cmp-4f.x: New file.
	* gcc.c-torture/execute/ieee/fp-cmp-4l.x: New file.
	* gcc.c-torture/execute/loop-9.c: Add -std=gnu17.
	* gcc.c-torture/execute/pr103209.c: Add -std=gnu17.
	* gcc.c-torture/execute/pr28289.c: Add -std=gnu17.
	* gcc.c-torture/execute/pr34982.c: Add -std=gnu17.
	* gcc.c-torture/execute/pr67037.c: Add -std=gnu17.
	* gcc.c-torture/execute/va-arg-2.c: Add -std=gnu17.
	* gcc.dg/20010202-1.c: Add -std=gnu17.
	* gcc.dg/20020430-1.c: Add -std=gnu17.
	* gcc.dg/20031218-3.c: Add -std=gnu17.
	* gcc.dg/20040127-1.c: Add -std=gnu17.
	* gcc.dg/20041014-1.c: Add -Wno-old-style-definition.
	* gcc.dg/20041122-1.c: Add -std=gnu17.
	* gcc.dg/20050309-1.c: Add -std=gnu17.
	* gcc.dg/20061026.c: Add -std=gnu17.
	* gcc.dg/20101010-1.c: Add -std=gnu17.
	* gcc.dg/Warray-parameter-10.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch-2.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch-3.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch-4.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch-5.c: Add -std=gnu17.
	* gcc.dg/Wbuiltin-declaration-mismatch.c: Add -std=gnu17.
	* gcc.dg/Wcxx-compat-2.c: Add -std=gnu17.
	* gcc.dg/Wdouble-promotion.c: Add -std=gnu17.
	* gcc.dg/Wfree-nonheap-object-7.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-1.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-1a.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-2.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-3.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-4.c: Add -std=gnu17.
	* gcc.dg/Wimplicit-int-4a.c: Add -std=gnu17.
	* gcc.dg/Wincompatible-pointer-types-1.c: Add -std=gnu17.
	* gcc.dg/Wrestrict-19.c: Add -std=gnu17.
	* gcc.dg/Wrestrict-4.c: Add -std=gnu17.
	* gcc.dg/Wrestrict-5.c: Add -std=gnu17.
	* gcc.dg/Wstrict-overflow-20.c: Add -std=gnu17.
	* gcc.dg/Wstringop-overflow-13.c: Add -std=gnu17.
	* gcc.dg/analyzer/doom-d_main-IdentifyVersion.c: Add -std=gnu17.
	* gcc.dg/analyzer/doom-s_sound-pr108867.c: Add -std=gnu17.
	* gcc.dg/analyzer/pr93032-mztools-signed-char.c: Add
	-Wno-old-style-definition.
	* gcc.dg/analyzer/pr93032-mztools-unsigned-char.c: Add
	-Wno-old-style-definition.
	* gcc.dg/analyzer/pr93355-localealias.c: Add
	-Wno-old-style-definition.
	* gcc.dg/analyzer/pr93375.c: Add -std=gnu17.
	* gcc.dg/analyzer/pr94688.c: Add -std=gnu17.
	* gcc.dg/analyzer/sensitive-1.c: Add -std=gnu17.
	* gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c:
	Add -std=gnu17.
	* gcc.dg/analyzer/torture/pr104863.c: Add -std=gnu17.
	* gcc.dg/analyzer/torture/pr93379.c: Add -std=gnu17.
	* gcc.dg/array-quals-2.c: Add -std=gnu17.
	* gcc.dg/attr-invalid.c: Add -Wno-old-style-definition.
	* gcc.dg/auto-init-uninit-A.c: Add -Wno-old-style-definition.
	* gcc.dg/builtin-choose-expr.c: Declare exit with (int) prototype.
	* gcc.dg/builtin-tgmath-err-1.c: Add -std=gnu17.
	* gcc.dg/builtins-30.c: Add -std=gnu17.
	* gcc.dg/cast-function-1.c: Add -std=gnu17.
	* gcc.dg/cleanup-1.c: Add -std=gnu17.
	* gcc.dg/compat/struct-complex-1_x.c: Add -std=gnu17.
	* gcc.dg/compat/struct-complex-2_x.c: Add -std=gnu17.
	* gcc.dg/compat/union-m128-1_x.c: Add -std=gnu17.
	* gcc.dg/debug/dwarf2/pr66482.c: Add -std=gnu17.
	* gcc.dg/dfp/composite-type-2.c: Add -std=gnu17.
	* gcc.dg/dfp/composite-type.c: Add -std=gnu17.
	* gcc.dg/dfp/keywords-pedantic.c: Add -std=gnu17.
	* gcc.dg/dremf-type-compat-1.c: Add -std=gnu17.
	* gcc.dg/dremf-type-compat-2.c: Add -std=gnu17.
	* gcc.dg/dremf-type-compat-3.c: Add -std=gnu17.
	* gcc.dg/dremf-type-compat-4.c: Add -std=gnu17.
	* gcc.dg/enum-compat-1.c: Add -std=gnu17.
	* gcc.dg/enum-compat-2.c: Add -std=gnu17.
	* gcc.dg/floatn-errs.c: Add -std=gnu17.
	* gcc.dg/fltconst-pedantic-dfp.c: Add -std=gnu17.
	* gcc.dg/format/proto.c: Add -std=gnu17.
	* gcc.dg/format/sentinel-1.c: Add -std=gnu17.
	* gcc.dg/gomp/declare-simd-1.c: Add -Wno-old-style-definition.
	* gcc.dg/ifelse-1.c: Add -Wno-old-style-definition.
	* gcc.dg/inline-33.c: Add -std=gnu17.
	* gcc.dg/ipa/inline-5.c: Add -std=gnu17.
	* gcc.dg/ipa/ipa-sra-21.c: Add -std=gnu17.
	* gcc.dg/ipa/pr102714.c: Add -std=gnu17.
	* gcc.dg/ipa/pr104813.c: Add -std=gnu17.
	* gcc.dg/ipa/pr108679.c: Add -std=gnu17.
	* gcc.dg/ipa/pr42706.c: Add -std=gnu17.
	* gcc.dg/ipa/pr88214.c: Add -Wno-old-style-definition.
	* gcc.dg/ipa/pr91853.c: Add -Wno-old-style-definition.
	* gcc.dg/ipa/pr93763.c: Add -std=gnu17.
	* gcc.dg/ipa/pr96482-2.c: Add -std=gnu17.
	* gcc.dg/lto/20091013-1_2.c: Add -std=gnu17.
	* gcc.dg/lto/20091015-1_2.c: Add -std=gnu17.
	* gcc.dg/lto/pr113197_1.c: Add -std=gnu17.
	* gcc.dg/lto/pr54702_1.c: Add -std=gnu17.
	* gcc.dg/lto/pr99849_0.c: Add -std=gnu17.
	* gcc.dg/noncompile/920923-1.c: Add -std=gnu17.
	* gcc.dg/noncompile/old-style-parm-1.c: Add
	-Wno-old-style-definition.
	* gcc.dg/noncompile/old-style-parm-3.c: Add
	-Wno-old-style-definition.
	* gcc.dg/noncompile/pr30552-2.c: Add -Wno-old-style-definition.
	* gcc.dg/noncompile/pr30552-3.c: Add -std=gnu17.
	* gcc.dg/noncompile/pr71265.c: Add -Wno-old-style-definition.
	* gcc.dg/noncompile/pr79758-2.c: Add -Wno-old-style-definition.
	* gcc.dg/noncompile/pr79758.c: Add -Wno-old-style-definition.
	* gcc.dg/noncompile/va-arg-1.c: Add -std=gnu17.
	* gcc.dg/old-style-prom-1.c: Add -std=gnu17.
	* gcc.dg/old-style-prom-2.c: Add -std=gnu17.
	* gcc.dg/old-style-prom-3.c: Add -std=gnu17.
	* gcc.dg/old-style-then-proto-1.c: Add -std=gnu17.
	* gcc.dg/parm-incomplete-1.c: Add -std=gnu17.
	* gcc.dg/parm-mismatch-1.c: Add -std=gnu17.
	* gcc.dg/permerror-default.c: Add -std=gnu17.
	* gcc.dg/permerror-fpermissive-nowarning.c: Add -std=gnu17.
	* gcc.dg/permerror-fpermissive.c: Add -std=gnu17.
	* gcc.dg/permerror-noerror.c: Add -std=gnu17.
	* gcc.dg/permerror-nowarning.c: Add -std=gnu17.
	* gcc.dg/permerror-pedantic.c: Add -std=gnu17.
	* gcc.dg/plugin/infoleak-net-ethtool-ioctl.c: Add -std=gnu17.
	* gcc.dg/pointer-array-quals-1.c: Add -std=gnu17.
	* gcc.dg/pointer-array-quals-2.c: Add -std=gnu17.
	* gcc.dg/pr100791.c: Add -std=gnu17.
	* gcc.dg/pr100843.c: Add -std=gnu17.
	* gcc.dg/pr102273.c: Add -std=gnu17.
	* gcc.dg/pr102385.c: Add -std=gnu17.
	* gcc.dg/pr103222.c: Add -std=gnu17.
	* gcc.dg/pr105140.c: Add -std=gnu17.
	* gcc.dg/pr105150.c: Add -std=gnu17.
	* gcc.dg/pr105250.c: Add -std=gnu17.
	* gcc.dg/pr105972.c: Add -Wno-old-style-definition.
	* gcc.dg/pr111039.c: Add -std=gnu17.
	* gcc.dg/pr111407.c: Add -std=gnu17.
	* gcc.dg/pr111922.c: Add -Wno-old-style-definition.
	* gcc.dg/pr15236.c: Add -std=gnu17.
	* gcc.dg/pr17188-1.c: Add -std=gnu17.
	* gcc.dg/pr20368-1.c: Add -std=gnu17.
	* gcc.dg/pr20368-2.c: Add -std=gnu17.
	* gcc.dg/pr20368-3.c: Add -std=gnu17.
	* gcc.dg/pr27331.c: Add -Wno-old-style-definition.
	* gcc.dg/pr27861-1.c: Add -std=gnu17.
	* gcc.dg/pr28121.c: Add -std=gnu17.
	* gcc.dg/pr28243.c: Add -std=gnu17.
	* gcc.dg/pr28888.c: Add -std=gnu17.
	* gcc.dg/pr29254.c: Add -std=gnu17.
	* gcc.dg/pr34457-1.c: Add -std=gnu17.
	* gcc.dg/pr36015.c: Add -std=gnu17.
	* gcc.dg/pr38245-3.c: Add -std=gnu17.
	* gcc.dg/pr38245-4.c: Add -std=gnu17.
	* gcc.dg/pr41241.c: Add -std=gnu17.
	* gcc.dg/pr43058.c: Add -std=gnu17.
	* gcc.dg/pr44539.c: Add -std=gnu17.
	* gcc.dg/pr45055.c: Add -std=gnu17.
	* gcc.dg/pr50908.c: Add -Wno-old-style-definition.
	* gcc.dg/pr60647-1.c: Add -Wno-old-style-definition.
	* gcc.dg/pr63762.c: Add -std=gnu17.
	* gcc.dg/pr63804.c: Add -std=gnu17.
	* gcc.dg/pr68306-3.c: Add -std=gnu17.
	* gcc.dg/pr68533.c: Add -std=gnu17.
	* gcc.dg/pr69156.c: Add -std=gnu17.
	* gcc.dg/pr7356-2.c: Add -Wno-old-style-definition.
	* gcc.dg/pr79983.c: Add -std=gnu17.
	* gcc.dg/pr83463.c: Add -std=gnu17.
	* gcc.dg/pr87347.c: Add -std=gnu17.
	* gcc.dg/pr89521-1.c: Add -std=gnu17.
	* gcc.dg/pr89521-2.c: Add -std=gnu17.
	* gcc.dg/pr90648.c: Add -std=gnu17.
	* gcc.dg/pr93573-1.c: Add -std=gnu17.
	* gcc.dg/pr94167.c: Add -std=gnu17.
	* gcc.dg/pr94705.c: Add -std=gnu17.
	* gcc.dg/pr95118.c: Add -std=gnu17.
	* gcc.dg/pr96335.c: Add -std=gnu17.
	* gcc.dg/pr97830.c: Add -std=gnu17.
	* gcc.dg/pr97882.c: Add -std=gnu17.
	* gcc.dg/pr99122-2.c: Add -std=gnu17.
	* gcc.dg/pr99122-3.c: Add -std=gnu17.
	* gcc.dg/qual-component-1.c: Add -std=gnu17.
	* gcc.dg/sibcall-6.c: Add -Wno-old-style-definition.
	* gcc.dg/sms-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tm/20091221.c: Add -std=gnu17.
	* gcc.dg/torture/bfloat16-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float128-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float128x-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float16-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float32-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float32x-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float64-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/float64x-basic.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr102762.c: Add -std=gnu17.
	* gcc.dg/torture/pr103987.c: Add -std=gnu17.
	* gcc.dg/torture/pr104825.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr105166.c: Add -std=gnu17.
	* gcc.dg/torture/pr105185.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr109652.c: Add -std=gnu17.
	* gcc.dg/torture/pr112444.c: Add -std=gnu17.
	* gcc.dg/torture/pr113895-3.c: Add -std=gnu17.
	* gcc.dg/torture/pr24626-2.c: Add -std=gnu17.
	* gcc.dg/torture/pr25183.c: Add -std=gnu17.
	* gcc.dg/torture/pr38948.c: Add -std=gnu17.
	* gcc.dg/torture/pr44807.c: Add -std=gnu17.
	* gcc.dg/torture/pr47281.c: Add -std=gnu17.
	* gcc.dg/torture/pr47958-1.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr48063.c: Add -std=gnu17.
	* gcc.dg/torture/pr57036-1.c: Add -std=gnu17.
	* gcc.dg/torture/pr57330.c: Add -std=gnu17.
	* gcc.dg/torture/pr57584.c: Add -std=gnu17.
	* gcc.dg/torture/pr67741.c: Add -std=gnu17.
	* gcc.dg/torture/pr68104.c: Add -std=gnu17.
	* gcc.dg/torture/pr69242.c: Add -std=gnu17.
	* gcc.dg/torture/pr70457.c: Add -std=gnu17.
	* gcc.dg/torture/pr70985.c: Add -std=gnu17.
	* gcc.dg/torture/pr71606.c: Add -std=gnu17.
	* gcc.dg/torture/pr71816.c: Add -std=gnu17.
	* gcc.dg/torture/pr77286.c: Add -std=gnu17.
	* gcc.dg/torture/pr77646.c: Add -std=gnu17.
	* gcc.dg/torture/pr77677-2.c: Add -std=gnu17.
	* gcc.dg/torture/pr78365.c: Add -Wno-old-style-definition.
	* gcc.dg/torture/pr79732.c: Add -std=gnu17.
	* gcc.dg/torture/pr80612.c: Add -std=gnu17.
	* gcc.dg/torture/pr80764.c: Add -std=gnu17.
	* gcc.dg/torture/pr80842.c: Add -std=gnu17.
	* gcc.dg/torture/pr81900.c: Add -std=gnu17.
	* gcc.dg/torture/pr82276.c: Add -std=gnu17.
	* gcc.dg/torture/pr84803.c: Add -std=gnu17.
	* gcc.dg/torture/pr93124.c: Add -std=gnu17.
	* gcc.dg/torture/pr97330-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-prof/comp-goto-1.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/20030703-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030708-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030709-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030709-3.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030710-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030711-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030711-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030711-3.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030714-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030714-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030728-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-10.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-11.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-3.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-6.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030807-7.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030814-4.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030814-5.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030814-6.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20030918-1.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/20040514-2.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/loadpre7.c: Add -Wno-old-style-definition.
	* gcc.dg/tree-ssa/pr111003.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr115128.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr115191.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr24840.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr69666.c: Add -std=gnu17.
	* gcc.dg/tree-ssa/pr70232.c: Add -std=gnu17.
	* gcc.dg/ubsan/pr79757-1.c: Add -Wno-old-style-definition.
	* gcc.dg/ubsan/pr79757-2.c: Add -Wno-old-style-definition.
	* gcc.dg/ubsan/pr79757-3.c: Add -Wno-old-style-definition.
	* gcc.dg/ubsan/pr81223.c: Add -std=gnu17.
	* gcc.dg/uninit-10-O0.c: Add -Wno-old-style-definition.
	* gcc.dg/uninit-10.c: Add -Wno-old-style-definition.
	* gcc.dg/uninit-32.c: Add -std=gnu17.
	* gcc.dg/uninit-41.c: Add -std=gnu17.
	* gcc.dg/uninit-A-O0.c: Add -Wno-old-style-definition.
	* gcc.dg/uninit-A.c: Add -Wno-old-style-definition.
	* gcc.dg/unused-1.c: Add -Wno-old-style-definition.
	* gcc.dg/vect/bb-slp-pr114249.c: Add -std=gnu17.
	* gcc.dg/vect/bb-slp-pr97486.c: Add -std=gnu17.
	* gcc.dg/vect/bb-slp-subgroups-1.c: Add -std=gnu17.
	* gcc.dg/vect/bb-slp-subgroups-2.c: Add -std=gnu17.
	* gcc.dg/vect/bb-slp-subgroups-3.c: Add -std=gnu17.
	* gcc.dg/vect/vect-early-break_111-pr113731.c: Add -std=gnu17.
	* gcc.dg/vect/vect-early-break_122-pr114239.c: Add -std=gnu17.
	* gcc.dg/vect/vect-multi-peel-gaps.c: Add -std=gnu17.
	* gcc.dg/vla-stexp-2.c: Add -std=gnu17.
	* gcc.dg/warn-1.c: Add -Wno-old-style-definition.
	* gcc.dg/winline-10.c: Add -Wno-old-style-definition.
	* gcc.dg/wtr-label-1.c: Add -Wno-old-style-definition.
	* gcc.dg/wtr-switch-1.c: Add -Wno-old-style-definition.
	* gcc.target/i386/excess-precision-3.c: Add
	-Wno-old-style-definition.
	* gcc.target/i386/fma4-256-nmsubXX.c: Add -std=gnu17.
	* gcc.target/i386/fma4-nmsubXX.c: Add -std=gnu17.
	* gcc.target/i386/nop-mcount.c: Add -Wno-old-style-definition.
	* gcc.target/i386/pr102627.c: Add -std=gnu17.
	* gcc.target/i386/pr106994.c: Add -std=gnu17.
	* gcc.target/i386/pr68349.c: Add -std=gnu17.
	* gcc.target/i386/pr97313.c: Add -std=gnu17.
	* gcc.target/i386/pr99454.c: Add -std=gnu17.
	* gcc.target/i386/record-mcount.c: Add -Wno-old-style-definition.

libffi/
	* testsuite/libffi.call/va_struct2.c (test_fn): Cast n to void.
	* testsuite/libffi.call/va_struct3.c (test_fn): Likewise.
	Backported from <https://github.com/libffi/libffi/pull/861>.

diff --git a/gcc/testsuite/c-c++-common/Wcast-function-type.c b/gcc/testsuite/c-c++-common/Wcast-function-type.c
index b49da486814..8f2997d71fa 100644
--- a/gcc/testsuite/c-c++-common/Wcast-function-type.c
+++ b/gcc/testsuite/c-c++-common/Wcast-function-type.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
 /* { dg-options "-Wcast-function-type" } */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 
 int f(long);
 
diff --git a/gcc/testsuite/c-c++-common/Wformat-pr84258.c b/gcc/testsuite/c-c++-common/Wformat-pr84258.c
index d2870a88701..10fa9ba2133 100644
--- a/gcc/testsuite/c-c++-common/Wformat-pr84258.c
+++ b/gcc/testsuite/c-c++-common/Wformat-pr84258.c
@@ -1,4 +1,5 @@
 /* { dg-options "-Wformat" } */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 
 int main (int argc, char **argv)
 {
diff --git a/gcc/testsuite/c-c++-common/Wvarargs.c b/gcc/testsuite/c-c++-common/Wvarargs.c
index bfd8276a292..ea86ba30dcd 100644
--- a/gcc/testsuite/c-c++-common/Wvarargs.c
+++ b/gcc/testsuite/c-c++-common/Wvarargs.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 
 #include <stdarg.h>
 
diff --git a/gcc/testsuite/c-c++-common/analyzer/data-model-12.c b/gcc/testsuite/c-c++-common/analyzer/data-model-12.c
index 653b7ad6284..e4a7fbdae44 100644
--- a/gcc/testsuite/c-c++-common/analyzer/data-model-12.c
+++ b/gcc/testsuite/c-c++-common/analyzer/data-model-12.c
@@ -1,4 +1,5 @@
 /* Mismatching decl of foo.  */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 
 int foo ();
 
diff --git a/gcc/testsuite/c-c++-common/builtins.c b/gcc/testsuite/c-c++-common/builtins.c
index 527c77e7952..f44d0d3286b 100644
--- a/gcc/testsuite/c-c++-common/builtins.c
+++ b/gcc/testsuite/c-c++-common/builtins.c
@@ -2,7 +2,7 @@
    with no prototype do not cause an ICE.
   { dg-do compile }
   { dg-options "-O2 -Wall -Wextra" }
-  { dg-additional-options "-fpermissive" { target c } }
+  { dg-additional-options "-std=gnu17 -fpermissive" { target c } }
   { dg-prune-output "warning" }
   { dg-require-effective-target alloca }  */
 
diff --git a/gcc/testsuite/c-c++-common/pointer-to-fn1.c b/gcc/testsuite/c-c++-common/pointer-to-fn1.c
index 70a5831c958..862ca7ab682 100644
--- a/gcc/testsuite/c-c++-common/pointer-to-fn1.c
+++ b/gcc/testsuite/c-c++-common/pointer-to-fn1.c
@@ -1,6 +1,7 @@
 /* PR c++/106937 */
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
 /* { dg-options "-fpermissive -fcf-protection" } */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 /* { dg-additional-options "-std=c++11" { target c++ } } */
 /* Test printing a pointer to function with attribute.  */
 
diff --git a/gcc/testsuite/c-c++-common/pragma-diag-17.c b/gcc/testsuite/c-c++-common/pragma-diag-17.c
index a44ce90f98b..93206f0e35b 100644
--- a/gcc/testsuite/c-c++-common/pragma-diag-17.c
+++ b/gcc/testsuite/c-c++-common/pragma-diag-17.c
@@ -1,5 +1,6 @@
 /* Test silencing the numeric constant extension pedwarns.  */
 /* { dg-options "-pedantic-errors" } */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 /* { dg-additional-options -fext-numeric-literals { target c++14 } } */
 
 #pragma GCC diagnostic push
diff --git a/gcc/testsuite/c-c++-common/sizeof-array-argument.c b/gcc/testsuite/c-c++-common/sizeof-array-argument.c
index eedfceec2cf..f2b2d33289a 100644
--- a/gcc/testsuite/c-c++-common/sizeof-array-argument.c
+++ b/gcc/testsuite/c-c++-common/sizeof-array-argument.c
@@ -1,5 +1,6 @@
 /* PR c/6940 */
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" { target c } } */
 
 /* Test -Wsizeof-array-argument warning.  */
 
diff --git a/gcc/testsuite/g++.dg/lto/pr54625-1_0.c b/gcc/testsuite/g++.dg/lto/pr54625-1_0.c
index b1455e8c90b..59df1aaf58f 100644
--- a/gcc/testsuite/g++.dg/lto/pr54625-1_0.c
+++ b/gcc/testsuite/g++.dg/lto/pr54625-1_0.c
@@ -1,5 +1,5 @@
 /* { dg-lto-do link } */
-/* { dg-lto-options { { -O0 -flto -w } { -O2 -flto -w } }  } */
+/* { dg-lto-options { { -O0 -flto -w -std=gnu17 } { -O2 -flto -w -std=gnu17 } }  } */
 /* { dg-extra-ld-options { -r -nostdlib -flinker-output=nolto-rel } } */
 
 float a;
diff --git a/gcc/testsuite/g++.dg/lto/pr54625-2_0.c b/gcc/testsuite/g++.dg/lto/pr54625-2_0.c
index 1ba463d70e8..b7a53c6bc9a 100644
--- a/gcc/testsuite/g++.dg/lto/pr54625-2_0.c
+++ b/gcc/testsuite/g++.dg/lto/pr54625-2_0.c
@@ -1,5 +1,5 @@
 /* { dg-lto-do link } */
-/* { dg-lto-options { { -O0 -flto -w } { -O2 -flto -w } }  } */
+/* { dg-lto-options { { -O0 -flto -w -std=gnu17 } { -O2 -flto -w -std=gnu17 } }  } */
 /* { dg-extra-ld-options { -r -nostdlib -flinker-output=nolto-rel } } */
 
 float a;
diff --git a/gcc/testsuite/gcc.c-torture/compile/20040214-2.c b/gcc/testsuite/gcc.c-torture/compile/20040214-2.c
index 352d5a5d764..a4fe1d27865 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20040214-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20040214-2.c
@@ -1,4 +1,5 @@
 /* http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01307.html */
+/* { dg-additional-options "-std=gnu17" } */
 
 typedef struct xdef xdef;
 struct xdef
diff --git a/gcc/testsuite/gcc.c-torture/compile/921011-2.c b/gcc/testsuite/gcc.c-torture/compile/921011-2.c
index bf11dad979f..dbee9542021 100644
--- a/gcc/testsuite/gcc.c-torture/compile/921011-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/921011-2.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 extern int foobar1 ();
 
 typedef struct
diff --git a/gcc/testsuite/gcc.c-torture/compile/931102-1.c b/gcc/testsuite/gcc.c-torture/compile/931102-1.c
index f60b2799302..83568c1209b 100644
--- a/gcc/testsuite/gcc.c-torture/compile/931102-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/931102-1.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 char *e ();
 
 #define SET \
diff --git a/gcc/testsuite/gcc.c-torture/compile/990801-1.c b/gcc/testsuite/gcc.c-torture/compile/990801-1.c
index d35ec87b948..6459a1174c9 100644
--- a/gcc/testsuite/gcc.c-torture/compile/990801-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/990801-1.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 extern int getch();
 extern int class();
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/nested-1.c b/gcc/testsuite/gcc.c-torture/compile/nested-1.c
index 135538a8524..7baade75283 100644
--- a/gcc/testsuite/gcc.c-torture/compile/nested-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/nested-1.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target trampolines } */
 
 typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c b/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c
index 593ef96bdb7..1104580a4e6 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c
@@ -1,5 +1,6 @@
 /* { dg-require-visibility "" } */
 /* { dg-options "-fvisibility=internal -fPIC" { target fpic } } */
+/* { dg-additional-options "-std=gnu17" } */
 
 extern char num_4x4_blocks_high_lookup, num_4x4_blocks_wide_lookup,
     vp9_foreach_transformed_block_in_plane_xd_0_0_0;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr106101.c b/gcc/testsuite/gcc.c-torture/compile/pr106101.c
index e307afcbccc..664ecec1053 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr106101.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr106101.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 extern char *globerr;
 char **ftpglob();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr113616.c b/gcc/testsuite/gcc.c-torture/compile/pr113616.c
index 04c38eadffb..a862e8bd91c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr113616.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr113616.c
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-g" }
+// { dg-options "-std=gnu17 -g" }
 struct A { struct A *a; } foo ();
 struct B { long b; };
 struct C { struct B c; struct A d; } *e;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr47967.c b/gcc/testsuite/gcc.c-torture/compile/pr47967.c
index fe1f9c2ef75..39d73c6bfff 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr47967.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr47967.c
@@ -1,4 +1,5 @@
 /* PR tree-optimization/47967 */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target untyped_assembly } */
 
 extern void abort (void);
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr51694.c b/gcc/testsuite/gcc.c-torture/compile/pr51694.c
index 9eddc0bf405..00e6ea378a7 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr51694.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr51694.c
@@ -1,6 +1,6 @@
 /* { dg-require-effective-target untyped_assembly } */
 /* { dg-require-effective-target indirect_calls } */
-/* { dg-additional-options "-fpermissive" } */
+/* { dg-additional-options "-std=gnu17 -fpermissive" } */
 
 void
 foo (x, fn)
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr71109.c b/gcc/testsuite/gcc.c-torture/compile/pr71109.c
index b44ba07123e..fae98fb019d 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr71109.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr71109.c
@@ -1,4 +1,5 @@
 /* PR tree-optimization/71109 */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 struct S { int g, h; signed char i; int j; signed char k; int l[4]; } a, c;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c b/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c
index 4718a276bdb..3d49ed817b0 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fno-early-inlining" } */
+/* { dg-options "-std=gnu17 -fno-early-inlining" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 void
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c b/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c
index 659925d6c87..13ffa903561 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c
@@ -1,4 +1,5 @@
 /* PR middle-end/89663 */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 int irint ();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr94238.c b/gcc/testsuite/gcc.c-torture/compile/pr94238.c
index 5a96a64d85b..0d32cebd9de 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr94238.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr94238.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 enum { false, true } a;
 int b, c, d, e, f;
 int fn3();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr96796.c b/gcc/testsuite/gcc.c-torture/compile/pr96796.c
index debbe62e22f..8deee01237f 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr96796.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr96796.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-fpermissive -fcommon" } */
+/* { dg-additional-options "-std=gnu17 -fpermissive -fcommon" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 struct S0 {
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr97576.c b/gcc/testsuite/gcc.c-torture/compile/pr97576.c
index d2816132cc0..4bcadabcca0 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr97576.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr97576.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 void
diff --git a/gcc/testsuite/gcc.c-torture/compile/udivmod4.c b/gcc/testsuite/gcc.c-torture/compile/udivmod4.c
index 9d98a3d575d..5297dc9d2f1 100644
--- a/gcc/testsuite/gcc.c-torture/compile/udivmod4.c
+++ b/gcc/testsuite/gcc.c-torture/compile/udivmod4.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-fpermissive" } */
+/* { dg-additional-options "-std=gnu17 -fpermissive" } */
 
 long long
 xlrandom ()
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010605-2.c b/gcc/testsuite/gcc.c-torture/execute/20010605-2.c
index 837e0a960d6..ef435bc00ee 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20010605-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20010605-2.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-fpermissive" } */
+/* { dg-additional-options "-std=gnu17 -fpermissive" } */
 
 void foo (), bar (), baz ();
 int main ()
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020404-1.c b/gcc/testsuite/gcc.c-torture/execute/20020404-1.c
index 53b34083400..95b0adc0244 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20020404-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20020404-1.c
@@ -1,4 +1,5 @@
 /* { dg-require-effective-target int32plus } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-skip-if "pointers can be truncated" { m32c-*-* } } */
 /* Extracted from GDB sources. */
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030714-1.c b/gcc/testsuite/gcc.c-torture/execute/20030714-1.c
index 719baede26f..443fea84dda 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20030714-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20030714-1.c
@@ -1,4 +1,5 @@
 /* derived from PR optimization/11440  */
+/* { dg-additional-options "-std=gnu17" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/20051012-1.c b/gcc/testsuite/gcc.c-torture/execute/20051012-1.c
index d43aeda8285..e9240da06d3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20051012-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20051012-1.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target untyped_assembly } */
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20190820-1.c b/gcc/testsuite/gcc.c-torture/execute/20190820-1.c
index 10e48d35750..c122ff38dac 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20190820-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20190820-1.c
@@ -1,5 +1,6 @@
 /* PR rtl-optimization/91347 */
 /* Reported by John David Anglin <danglin@gcc.gnu.org> */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target int32plus } */
 
 typedef unsigned short __u16;
diff --git a/gcc/testsuite/gcc.c-torture/execute/920612-1.c b/gcc/testsuite/gcc.c-torture/execute/920612-1.c
index 8553de2c5af..2f369b516f9 100644
--- a/gcc/testsuite/gcc.c-torture/execute/920612-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/920612-1.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fwrapv" } */
+/* { dg-options "-Wno-old-style-definition -fwrapv" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/930608-1.c b/gcc/testsuite/gcc.c-torture/execute/930608-1.c
index 1f29aa5d07b..fd267590481 100644
--- a/gcc/testsuite/gcc.c-torture/execute/930608-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/930608-1.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 void abort (void);
 void exit (int);
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
index 6be63c097ac..7bfc9d4f12a 100644
--- a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target label_values } */
 /* { dg-require-stack-size "4000" } */
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x
index 84c193fe0e4..ec107bc50c3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x
@@ -13,4 +13,6 @@ if [istarget "arm*-*-vxworks*"] {
     }
 }
 
+lappend additional_flags "-std=gnu17"
+
 return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x
index 84c193fe0e4..ec107bc50c3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x
@@ -13,4 +13,6 @@ if [istarget "arm*-*-vxworks*"] {
     }
 }
 
+lappend additional_flags "-std=gnu17"
+
 return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x
index 84c193fe0e4..ec107bc50c3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x
@@ -13,4 +13,6 @@ if [istarget "arm*-*-vxworks*"] {
     }
 }
 
+lappend additional_flags "-std=gnu17"
+
 return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.x
new file mode 100644
index 00000000000..9baf8e1cbbb
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.x
@@ -0,0 +1,2 @@
+lappend additional_flags "-std=gnu17"
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.x
new file mode 100644
index 00000000000..9baf8e1cbbb
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.x
@@ -0,0 +1,2 @@
+lappend additional_flags "-std=gnu17"
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.x
new file mode 100644
index 00000000000..9baf8e1cbbb
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.x
@@ -0,0 +1,2 @@
+lappend additional_flags "-std=gnu17"
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-9.c b/gcc/testsuite/gcc.c-torture/execute/loop-9.c
index 523057593a3..c0798c32446 100644
--- a/gcc/testsuite/gcc.c-torture/execute/loop-9.c
+++ b/gcc/testsuite/gcc.c-torture/execute/loop-9.c
@@ -1,4 +1,5 @@
 /* Source: Neil Booth, from PR # 115.  */
+/* { dg-additional-options "-std=gnu17" } */
 
 int false()
 {
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr103209.c b/gcc/testsuite/gcc.c-torture/execute/pr103209.c
index 481689396f4..ecc23129676 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr103209.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr103209.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 #include <stdio.h>
 #include <stdint.h>
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr28289.c b/gcc/testsuite/gcc.c-torture/execute/pr28289.c
index 93e922cbb1f..276a0f4b901 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr28289.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr28289.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 extern int ok (int);
 extern void exit ();
 static int gen_x86_64_shrd (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr34982.c b/gcc/testsuite/gcc.c-torture/execute/pr34982.c
index 1500847d0e8..4289a184249 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr34982.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr34982.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 extern void abort (void);
 
 static void something();
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr67037.c b/gcc/testsuite/gcc.c-torture/execute/pr67037.c
index 3119d327b02..da626e8da8c 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr67037.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr67037.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 long (*extfunc)();
 
 static inline void lstrcpynW( short *d, const short *s, int n )
diff --git a/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c b/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c
index 56f8e14fdde..d44cefc1427 100644
--- a/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c
@@ -2,6 +2,7 @@
    in regs and on the stack.  We test 16 cases, trying to catch multiple
    targets (some use 3 regs for argument passing, some use 12, etc.).
    We test both the arguments and the `lastarg' (the argument to va_start).  */
+/* { dg-additional-options "-std=gnu17" } */
 
 #include <stdarg.h>
 
diff --git a/gcc/testsuite/gcc.dg/20010202-1.c b/gcc/testsuite/gcc.dg/20010202-1.c
index 5f789042eba..418e552cd57 100644
--- a/gcc/testsuite/gcc.dg/20010202-1.c
+++ b/gcc/testsuite/gcc.dg/20010202-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile { target i?86-*-* sparc*-*-* x86_64-*-* } } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.dg/20020430-1.c b/gcc/testsuite/gcc.dg/20020430-1.c
index f48bb672aaf..2690b3835d9 100644
--- a/gcc/testsuite/gcc.dg/20020430-1.c
+++ b/gcc/testsuite/gcc.dg/20020430-1.c
@@ -5,7 +5,7 @@
    which left a reference to the deleted ADDR_VEC.  */
 
 /* { dg-do compile { target fpic } } */
-/* { dg-options "-O2 -frename-registers -fpic" } */
+/* { dg-options "-std=gnu17 -O2 -frename-registers -fpic" } */
 /* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
 
 typedef unsigned long XID;
diff --git a/gcc/testsuite/gcc.dg/20031218-3.c b/gcc/testsuite/gcc.dg/20031218-3.c
index 0bae456b8e7..10f8e775f11 100644
--- a/gcc/testsuite/gcc.dg/20031218-3.c
+++ b/gcc/testsuite/gcc.dg/20031218-3.c
@@ -3,7 +3,7 @@
    The problem was that this just to ICE with -O2 -g.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -g" } */
+/* { dg-options "-std=gnu17 -O2 -g" } */
 
 extern __SIZE_TYPE__ strlen (const char *);
 
diff --git a/gcc/testsuite/gcc.dg/20040127-1.c b/gcc/testsuite/gcc.dg/20040127-1.c
index 0ea6062a5a9..3295dee97e3 100644
--- a/gcc/testsuite/gcc.dg/20040127-1.c
+++ b/gcc/testsuite/gcc.dg/20040127-1.c
@@ -5,7 +5,7 @@
    floating-point registers on SPARC64.  */
 
 /* { dg-do assemble } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 extern int foo1();
 extern int foo2();
diff --git a/gcc/testsuite/gcc.dg/20041014-1.c b/gcc/testsuite/gcc.dg/20041014-1.c
index 699844074ed..b2e9959616d 100644
--- a/gcc/testsuite/gcc.dg/20041014-1.c
+++ b/gcc/testsuite/gcc.dg/20041014-1.c
@@ -1,6 +1,6 @@
 /* PR c/17023 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 void
 f(a, b)
diff --git a/gcc/testsuite/gcc.dg/20041122-1.c b/gcc/testsuite/gcc.dg/20041122-1.c
index b2120f81545..889c7815eb3 100644
--- a/gcc/testsuite/gcc.dg/20041122-1.c
+++ b/gcc/testsuite/gcc.dg/20041122-1.c
@@ -1,6 +1,6 @@
 /* PR rtl-optimization/18611 */
 /* { dg-do compile } */
-/* { dg-options "-O1 -fmove-loop-invariants" } */
+/* { dg-options "-std=gnu17 -O1 -fmove-loop-invariants" } */
 
 void dumpCineonChannelInfo ();
 typedef struct {
diff --git a/gcc/testsuite/gcc.dg/20050309-1.c b/gcc/testsuite/gcc.dg/20050309-1.c
index 46b27f82e29..d17bdaf30bc 100644
--- a/gcc/testsuite/gcc.dg/20050309-1.c
+++ b/gcc/testsuite/gcc.dg/20050309-1.c
@@ -3,7 +3,7 @@
 
 /* { dg-do compile } */
 /* { dg-require-profiling "-fprofile-generate" } */
-/* { dg-options "-O2 -fprofile-generate" } */
+/* { dg-options "-std=gnu17 -O2 -fprofile-generate" } */
 
 void lookup ();
 int hash ();
diff --git a/gcc/testsuite/gcc.dg/20061026.c b/gcc/testsuite/gcc.dg/20061026.c
index fa8069ce4cf..dbba84eab91 100644
--- a/gcc/testsuite/gcc.dg/20061026.c
+++ b/gcc/testsuite/gcc.dg/20061026.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1" } */
+/* { dg-options "-std=gnu17 -O1" } */
 /* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
 
 /* This testcase failed on s390.  The frame size for function f will be
diff --git a/gcc/testsuite/gcc.dg/20101010-1.c b/gcc/testsuite/gcc.dg/20101010-1.c
index 2067012ebcd..d47071742b5 100644
--- a/gcc/testsuite/gcc.dg/20101010-1.c
+++ b/gcc/testsuite/gcc.dg/20101010-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-crossjumping" } */
+/* { dg-options "-std=gnu17 -O2 -fno-crossjumping" } */
 /* { dg-require-effective-target alloca } */
 
 int bar1 ();
diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-10.c b/gcc/testsuite/gcc.dg/Warray-parameter-10.c
index 378f8afbd34..b10a82d0432 100644
--- a/gcc/testsuite/gcc.dg/Warray-parameter-10.c
+++ b/gcc/testsuite/gcc.dg/Warray-parameter-10.c
@@ -1,7 +1,7 @@
 /* PR c/102759 - ICE calling a function taking an argument redeclared
    without a prototype.
    { dg-do compile }
-   { dg-options "-Wall" } */
+   { dg-options "-std=gnu17 -Wall" } */
 
 void f (void)
 {
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-2.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-2.c
index 9d75cd8669c..42733cda815 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-2.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-2.c
@@ -1,7 +1,7 @@
 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
    without prototype
    { dg-do compile }
-   { dg-options "-Wall -Wextra" } */
+   { dg-options "-std=gnu17 -Wall -Wextra" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-3.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-3.c
index bc652793323..91363ed1de5 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-3.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-3.c
@@ -1,7 +1,7 @@
 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
    without prototype
    { dg-do compile }
-   { dg-options "-fpermissive -Wbuiltin-declaration-mismatch" } */
+   { dg-options "-std=gnu17 -fpermissive -Wbuiltin-declaration-mismatch" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
index e845b43c073..c48fe5fcf30 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
@@ -1,7 +1,7 @@
 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
    without prototype
    { dg-do compile }
-   { dg-options "-Wbuiltin-declaration-mismatch" } */
+   { dg-options "-std=gnu17 -Wbuiltin-declaration-mismatch" } */
 
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 typedef __SIZE_TYPE__    size_t;
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-5.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-5.c
index 9cac9277750..08e677e0605 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-5.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-5.c
@@ -1,6 +1,6 @@
 /* PR testsuite/88098 - FAIL: gcc.dg/Wbuiltin-declaration-mismatch-4.c
    { dg-do compile }
-   { dg-options "-Wbuiltin-declaration-mismatch -fshort-enums" } */
+   { dg-options "-std=gnu17 -Wbuiltin-declaration-mismatch -fshort-enums" } */
 
 int abs ();
 double fabs ();     /* { dg-message "built-in .fabs. declared here" } */
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c
index ed66fd3626b..fb456e0421c 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c
@@ -1,7 +1,7 @@
 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
    without prototype
    { dg-do compile }
-   { dg-options "-Wall" } */
+   { dg-options "-std=gnu17 -Wall" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-2.c b/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
index 4578bece109..938414aee8e 100644
--- a/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
+++ b/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
@@ -1,4 +1,4 @@
-/* { dg-options "-Wc++-compat" } */
+/* { dg-options "-std=gnu17 -Wc++-compat" } */
 
 _Bool foo;			/* This is okay.  */
 int bool;			/* { dg-warning "5:keyword" } */
diff --git a/gcc/testsuite/gcc.dg/Wdouble-promotion.c b/gcc/testsuite/gcc.dg/Wdouble-promotion.c
index 0ad77915d8a..c002b2ef148 100644
--- a/gcc/testsuite/gcc.dg/Wdouble-promotion.c
+++ b/gcc/testsuite/gcc.dg/Wdouble-promotion.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -Wdouble-promotion" } */
+/* { dg-options "-std=gnu17 -fpermissive -Wdouble-promotion" } */
 
 #include <stddef.h>
 
diff --git a/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c b/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c
index 6116bfa4d8e..52cfbf9ec5d 100644
--- a/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c
+++ b/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wfree-nonheap-object" } */
+/* { dg-options "-std=gnu17 -O2 -Wfree-nonheap-object" } */
 
 struct local_caches *get_local_caches_lcs;
 void *calloc(long, long);
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-1.c b/gcc/testsuite/gcc.dg/Wimplicit-int-1.c
index fc7726c517e..206db40e4cd 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-1.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 
 static l; /* { dg-warning "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-1a.c b/gcc/testsuite/gcc.dg/Wimplicit-int-1a.c
index ef1835e2d3a..0f7880d117f 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-1a.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-1a.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17 " } */
 
 static l; /* { dg-error "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-2.c b/gcc/testsuite/gcc.dg/Wimplicit-int-2.c
index 4ff16f36738..cd2c1ef2441 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-2.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 static l; /* { dg-error "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-3.c b/gcc/testsuite/gcc.dg/Wimplicit-int-3.c
index 654ce736c25..5980c81afb8 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-3.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors -Wno-implicit-int" } */
+/* { dg-options "-std=gnu17 -pedantic-errors -Wno-implicit-int" } */
 
 static l;
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-4.c b/gcc/testsuite/gcc.dg/Wimplicit-int-4.c
index 99c61a76ecf..28f5da5eed5 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-4.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-4.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -Wno-implicit -Wimplicit-int" } */
+/* { dg-options "-std=gnu17 -fpermissive -Wno-implicit -Wimplicit-int" } */
 
 static l; /* { dg-warning "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-4a.c b/gcc/testsuite/gcc.dg/Wimplicit-int-4a.c
index 920a088f02b..b507620300a 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-4a.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-4a.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Wno-implicit -Wimplicit-int" } */
+/* { dg-options "-std=gnu17 -Wno-implicit -Wimplicit-int" } */
 
 static l; /* { dg-error "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c b/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c
index 4ae7b1d99ce..4e47a30c234 100644
--- a/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c
+++ b/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 void f (int, ...);
 
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-19.c b/gcc/testsuite/gcc.dg/Wrestrict-19.c
index d4750537c55..73b4302fa87 100644
--- a/gcc/testsuite/gcc.dg/Wrestrict-19.c
+++ b/gcc/testsuite/gcc.dg/Wrestrict-19.c
@@ -1,7 +1,7 @@
 /* PR middle-end/89934 - ICE on a call with fewer arguments to strncpy
    declared without prototype
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-std=gnu17 -O2 -Wall" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-4.c b/gcc/testsuite/gcc.dg/Wrestrict-4.c
index a95960e751a..e7b62af9cc7 100644
--- a/gcc/testsuite/gcc.dg/Wrestrict-4.c
+++ b/gcc/testsuite/gcc.dg/Wrestrict-4.c
@@ -4,7 +4,7 @@
    without a prototype don't cause an ICE.
    { dg-do compile }
    { dg-prune-output "conflicting types for built-in" }
-   { dg-options "-O2 -Warray-bounds -Wrestrict" } */
+   { dg-options "-std=gnu17 -O2 -Warray-bounds -Wrestrict" } */
 
 void* memcpy ();
 void* memmove ();
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-5.c b/gcc/testsuite/gcc.dg/Wrestrict-5.c
index 4ea9176f1f5..00f942335b3 100644
--- a/gcc/testsuite/gcc.dg/Wrestrict-5.c
+++ b/gcc/testsuite/gcc.dg/Wrestrict-5.c
@@ -4,7 +4,7 @@
    functions declared with no prototype are checked for overlap, and that
    invalid calls are ignored.
   { dg-do compile }
-  { dg-options "-O2 -fpermissive -Wrestrict" }  */
+  { dg-options "-std=gnu17 -O2 -fpermissive -Wrestrict" }  */
 
 void* memcpy ();
 char* strncpy ();
diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c b/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c
index ae2db93c612..260d20c9c9c 100644
--- a/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c
+++ b/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
+/* { dg-options "-std=gnu17 -fstrict-overflow -O2 -Wstrict-overflow" } */
 
 /* Don't warn about an overflow in a copied loop header.  We used to
    get a warning in value numbering.  This is PR 33565.  */
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
index 021eaae335d..2c882909e7f 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
@@ -3,7 +3,7 @@
    PR middle-end/89911 - ICE on a call with no arguments to strnlen
    declared with no prototype
    { dg-do compile }
-   { dg-options "-O2 -fpermissive -Wall" } */
+   { dg-options "-std=gnu17 -O2 -fpermissive -Wall" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/analyzer/doom-d_main-IdentifyVersion.c b/gcc/testsuite/gcc.dg/analyzer/doom-d_main-IdentifyVersion.c
index 982b9b74349..1605047c423 100644
--- a/gcc/testsuite/gcc.dg/analyzer/doom-d_main-IdentifyVersion.c
+++ b/gcc/testsuite/gcc.dg/analyzer/doom-d_main-IdentifyVersion.c
@@ -1,6 +1,6 @@
 /* Reduced from Doom's d_main.c, which is under the GPLv2 or later.  */
 
-/* { dg-additional-options "-Wno-analyzer-too-complex" } */
+/* { dg-additional-options "-std=gnu17 -Wno-analyzer-too-complex" } */
 
 typedef __SIZE_TYPE__ size_t;
 typedef struct _IO_FILE FILE;
diff --git a/gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c b/gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c
index fdc21a2bec3..ac0a789a7bb 100644
--- a/gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c
+++ b/gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c
@@ -1,6 +1,6 @@
 /* Reduced from Doom's linuxdoom-1.10/s_sound.c, which is GPLv2 or later.  */
 
-/* { dg-additional-options "-fno-analyzer-call-summaries -Wno-analyzer-too-complex -Wno-analyzer-symbol-too-complex" } */
+/* { dg-additional-options "-std=gnu17 -fno-analyzer-call-summaries -Wno-analyzer-too-complex -Wno-analyzer-symbol-too-complex" } */
 /* { dg-require-effective-target size32plus } */
 
 typedef struct _IO_FILE FILE;
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
index 7a7320fca2b..1941e49f9e8 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
@@ -4,7 +4,7 @@
    removed.  */
 
 /* { dg-do "compile" } */
-/* { dg-additional-options "-fsigned-char" } */
+/* { dg-additional-options "-Wno-old-style-definition -fsigned-char" } */
 /* { dg-require-effective-target int32plus } */
 
 /* TODO (PR analyzer/112528): remove need for this.  */
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c
index 10832757127..ca7ab132163 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c
@@ -4,7 +4,7 @@
    removed.  */
 
 /* { dg-do "compile" } */
-/* { dg-additional-options "-funsigned-char" } */
+/* { dg-additional-options "-Wno-old-style-definition -funsigned-char" } */
 /* { dg-require-effective-target int32plus } */
 
 /* TODO (PR analyzer/112528): remove need for this.  */
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c
index 88d0fc1fe43..4ccba46f8da 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c
@@ -3,7 +3,7 @@
    Adapted from intl/localealias.c, with all #includes removed.  */
 
 /* { dg-do "compile" } */
-/* { dg-additional-options "-Wno-analyzer-too-complex" } */
+/* { dg-additional-options "-Wno-old-style-definition -Wno-analyzer-too-complex" } */
 /* TODO: remove the need for this option.  */
 /* { dg-require-effective-target alloca } */
 
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93375.c b/gcc/testsuite/gcc.dg/analyzer/pr93375.c
index f6108547fb7..34ca68b6417 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93375.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93375.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-Wno-implicit-int" } */
+/* { dg-additional-options "-std=gnu17 -Wno-implicit-int" } */
 
 extern void foo (void *) __attribute__((nonnull));
 
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94688.c b/gcc/testsuite/gcc.dg/analyzer/pr94688.c
index 8ea8bc3b288..06152d16f06 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr94688.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94688.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-skip-if "PR112705" { hppa*64*-*-* } } */
 int a, b;
 void d();
diff --git a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
index c66af927617..ee82bb68243 100644
--- a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 #include <stdio.h>
 
 /* Solaris needs this for <unistd.h> to declare getpass.  */
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c
index 4cbf43206dc..f5329d84341 100644
--- a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c
@@ -1,6 +1,6 @@
 /* { dg-do compile { target x86_64-*-* } } */
 /* { dg-require-effective-target lp64 } */
-/* { dg-additional-options "-fsanitize=bounds -fno-analyzer-call-summaries" } */
+/* { dg-additional-options "-std=gnu17 -fsanitize=bounds -fno-analyzer-call-summaries" } */
 /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
 
 /* Reduced from linux kernel: drivers/staging/wfx/sta.c (GPL-2.0)
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/pr104863.c b/gcc/testsuite/gcc.dg/analyzer/torture/pr104863.c
index 30ed4fe022d..6487e966f37 100644
--- a/gcc/testsuite/gcc.dg/analyzer/torture/pr104863.c
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/pr104863.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-fanalyzer-transitivity" } */
+/* { dg-additional-options "-std=gnu17 -fanalyzer-transitivity" } */
 /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
 
 extern void g();
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/pr93379.c b/gcc/testsuite/gcc.dg/analyzer/torture/pr93379.c
index 01465cf60e1..6d6ac1433c8 100644
--- a/gcc/testsuite/gcc.dg/analyzer/torture/pr93379.c
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/pr93379.c
@@ -1,2 +1,3 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 #include "../../torture/pr57330.c"
diff --git a/gcc/testsuite/gcc.dg/array-quals-2.c b/gcc/testsuite/gcc.dg/array-quals-2.c
index 7f33e3fb2ce..e49330d54a4 100644
--- a/gcc/testsuite/gcc.dg/array-quals-2.c
+++ b/gcc/testsuite/gcc.dg/array-quals-2.c
@@ -3,7 +3,7 @@
    lost in forming composite types.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "-pedantic -Wno-discarded-array-qualifiers" } */
+/* { dg-options "-std=gnu17 -pedantic -Wno-discarded-array-qualifiers" } */
 typedef const char T[1];
 typedef const char T2[1];
 typedef volatile char U[1];
diff --git a/gcc/testsuite/gcc.dg/attr-invalid.c b/gcc/testsuite/gcc.dg/attr-invalid.c
index a3315fa131b..87f3cbcfa90 100644
--- a/gcc/testsuite/gcc.dg/attr-invalid.c
+++ b/gcc/testsuite/gcc.dg/attr-invalid.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 #define CONCAT_(A,B) A ## B
 #define CONCAT(A,B) CONCAT_(A,B)
diff --git a/gcc/testsuite/gcc.dg/auto-init-uninit-A.c b/gcc/testsuite/gcc.dg/auto-init-uninit-A.c
index 0ef1d92a747..8347a6081e5 100644
--- a/gcc/testsuite/gcc.dg/auto-init-uninit-A.c
+++ b/gcc/testsuite/gcc.dg/auto-init-uninit-A.c
@@ -2,6 +2,6 @@
    May be a real bug in CSE. */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wall -ftrivial-auto-var-init=zero" } */
+/* { dg-options "-O2 -Wall -Wno-old-style-definition -ftrivial-auto-var-init=zero" } */
 
 #include "uninit-A.c"
diff --git a/gcc/testsuite/gcc.dg/builtin-choose-expr.c b/gcc/testsuite/gcc.dg/builtin-choose-expr.c
index ceac6051f78..e8c14b4f4b7 100644
--- a/gcc/testsuite/gcc.dg/builtin-choose-expr.c
+++ b/gcc/testsuite/gcc.dg/builtin-choose-expr.c
@@ -35,7 +35,7 @@
 
 
 extern void abort ();
-extern void exit ();
+extern void exit (int);
 
 void bad ()
 {
diff --git a/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c b/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c
index 9016ec742be..de764e3776a 100644
--- a/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c
+++ b/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c
@@ -1,7 +1,7 @@
 /* Test __builtin_tgmath: errors that indicate a bad definition of a
    type-generic macro rather than bad arguments in a call to it.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void *p;
 double d;
diff --git a/gcc/testsuite/gcc.dg/builtins-30.c b/gcc/testsuite/gcc.dg/builtins-30.c
index 37e5dba2db6..d6552e5bdcb 100644
--- a/gcc/testsuite/gcc.dg/builtins-30.c
+++ b/gcc/testsuite/gcc.dg/builtins-30.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Wall -Wshadow -fshow-column" } */
+/* { dg-options "-std=gnu17 -Wall -Wshadow -fshow-column" } */
 
 extern double strtod (const char *, char **);
 #define UNUSED __attribute__ ((unused))
diff --git a/gcc/testsuite/gcc.dg/cast-function-1.c b/gcc/testsuite/gcc.dg/cast-function-1.c
index 5228b559165..4bd713611fe 100644
--- a/gcc/testsuite/gcc.dg/cast-function-1.c
+++ b/gcc/testsuite/gcc.dg/cast-function-1.c
@@ -6,7 +6,7 @@
    prototype than the actual one.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O3" } */
+/* { dg-options "-std=gnu17 -O3" } */
 
 int foo1(int);
 int foo2();
diff --git a/gcc/testsuite/gcc.dg/cleanup-1.c b/gcc/testsuite/gcc.dg/cleanup-1.c
index c622a62a4ad..22d590087c6 100644
--- a/gcc/testsuite/gcc.dg/cleanup-1.c
+++ b/gcc/testsuite/gcc.dg/cleanup-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -Wall" } */
+/* { dg-options "-std=gnu17 -fpermissive -Wall" } */
 /* Validate expected warnings and errors.  */
 
 #define U	__attribute__((unused))
diff --git a/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c b/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c
index 0c672394870..ff567a5dd9b 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O -Wno-psabi" } */
+/* { dg-options "-std=gnu17 -O -Wno-psabi" } */
 
 
 #ifdef __x86_64__
diff --git a/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c b/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c
index 2fb9826eb0f..4ad5339ff91 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O -Wno-psabi" } */
+/* { dg-options "-std=gnu17 -O -Wno-psabi" } */
 
 
 #ifdef __x86_64__
diff --git a/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c b/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c
index 1f92303d95b..13044bd9706 100644
--- a/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c
+++ b/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O -msse2" } */
+/* { dg-options "-std=gnu17 -O -msse2" } */
 
 #include "union-m128-1.h"
 
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr66482.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr66482.c
index 880791c72d4..81fac10b5bf 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/pr66482.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr66482.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -gdwarf" } */
+/* { dg-options "-std=gnu17 -O3 -gdwarf" } */
 
 void f(int p) {}
 int g() {
diff --git a/gcc/testsuite/gcc.dg/dfp/composite-type-2.c b/gcc/testsuite/gcc.dg/dfp/composite-type-2.c
index 5c6d95cc200..3ae8a245f24 100644
--- a/gcc/testsuite/gcc.dg/dfp/composite-type-2.c
+++ b/gcc/testsuite/gcc.dg/dfp/composite-type-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O -Wall -ftrack-macro-expansion=0" } */
+/* { dg-options "-std=gnu17 -O -Wall -ftrack-macro-expansion=0" } */
 
 /* C99 6.2.7: Compatible type and composite type.  */
 
diff --git a/gcc/testsuite/gcc.dg/dfp/composite-type.c b/gcc/testsuite/gcc.dg/dfp/composite-type.c
index 2eb601400b5..ead335168d3 100644
--- a/gcc/testsuite/gcc.dg/dfp/composite-type.c
+++ b/gcc/testsuite/gcc.dg/dfp/composite-type.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -O -Wall -ftrack-macro-expansion=0" } */
+/* { dg-options "-std=gnu17 -fpermissive -O -Wall -ftrack-macro-expansion=0" } */
 
 /* C99 6.2.7: Compatible type and composite type.  */
 
diff --git a/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c b/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c
index bca51066be3..5740e024fb2 100644
--- a/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c
+++ b/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c
@@ -1,7 +1,7 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
-/* Decimal float is a GCC extension.  */
+/* Decimal float is a GCC extension before C23.  */
 
 _Decimal32 x;		/* { dg-warning "GCC extension|ISO C" } */
 _Decimal64 y;		/* { dg-warning "GCC extension|ISO C" } */
diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-1.c b/gcc/testsuite/gcc.dg/dremf-type-compat-1.c
index 79c55ef840c..79e5d5b5d8c 100644
--- a/gcc/testsuite/gcc.dg/dremf-type-compat-1.c
+++ b/gcc/testsuite/gcc.dg/dremf-type-compat-1.c
@@ -4,7 +4,7 @@
    so it should be permitted when the function is built in.  Bug
    16666.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 float dremf (float, float);
 
diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-2.c b/gcc/testsuite/gcc.dg/dremf-type-compat-2.c
index 980ead187e7..ffb56a73b91 100644
--- a/gcc/testsuite/gcc.dg/dremf-type-compat-2.c
+++ b/gcc/testsuite/gcc.dg/dremf-type-compat-2.c
@@ -5,7 +5,7 @@
    16666.  Test with -pedantic, where the problem should still be
    diagnosed.  */
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
 float dremf (float, float); /* { dg-warning "prototype declaration" } */
 
diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-3.c b/gcc/testsuite/gcc.dg/dremf-type-compat-3.c
index 3934a64e19f..ef36e0b6b12 100644
--- a/gcc/testsuite/gcc.dg/dremf-type-compat-3.c
+++ b/gcc/testsuite/gcc.dg/dremf-type-compat-3.c
@@ -5,7 +5,7 @@
    16666.  Test with -pedantic-errors, where the problem should still
    be diagnosed.  */
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 float dremf (float, float); /* { dg-error "prototype declaration" } */
 
diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-4.c b/gcc/testsuite/gcc.dg/dremf-type-compat-4.c
index b3a2c5ad5d7..27e2204ecff 100644
--- a/gcc/testsuite/gcc.dg/dremf-type-compat-4.c
+++ b/gcc/testsuite/gcc.dg/dremf-type-compat-4.c
@@ -3,7 +3,7 @@
    of old-style parameter declarations should only apply when the
    prototype is visible, not for a built-in prototype.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 float
 dremf(x, y) /* { dg-warning "conflicting types for built-in function 'dremf'" } */
diff --git a/gcc/testsuite/gcc.dg/enum-compat-1.c b/gcc/testsuite/gcc.dg/enum-compat-1.c
index b7352f6ddc3..15890677b6d 100644
--- a/gcc/testsuite/gcc.dg/enum-compat-1.c
+++ b/gcc/testsuite/gcc.dg/enum-compat-1.c
@@ -3,7 +3,7 @@
 /* Origin: Joseph Myers <jsm@polyomino.org.uk>, based on
    PR c/6024 from Richard Earnshaw <rearnsha@arm.com> */
 /* { dg-do compile } */
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 
 /* Original test from PR c/6024.  */
 enum e1 {a, b};
diff --git a/gcc/testsuite/gcc.dg/enum-compat-2.c b/gcc/testsuite/gcc.dg/enum-compat-2.c
index 69509012480..b42717e5939 100644
--- a/gcc/testsuite/gcc.dg/enum-compat-2.c
+++ b/gcc/testsuite/gcc.dg/enum-compat-2.c
@@ -3,7 +3,7 @@
 /* Origin: Joseph Myers <jsm@polyomino.org.uk>, based on
    PR c/6024 from Richard Earnshaw <rearnsha@arm.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 /* Original test from PR c/6024.  */
 enum e1 {a, b};
diff --git a/gcc/testsuite/gcc.dg/floatn-errs.c b/gcc/testsuite/gcc.dg/floatn-errs.c
index 0dcc2f1bb97..9fb3f90262c 100644
--- a/gcc/testsuite/gcc.dg/floatn-errs.c
+++ b/gcc/testsuite/gcc.dg/floatn-errs.c
@@ -1,6 +1,6 @@
 /* Tests for _FloatN / _FloatNx types: test erroneous code.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 /* { dg-add-options float32 } */
 /* { dg-add-options float64 } */
 /* { dg-add-options float32x } */
diff --git a/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c b/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
index 6ff3091ce6a..b395fbdf7ca 100644
--- a/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
+++ b/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
 double a = 1.dl;	/* { dg-warning "decimal float" } */
 /* { dg-error "not supported for this target" "not supported" { target { ! dfp } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/format/proto.c b/gcc/testsuite/gcc.dg/format/proto.c
index b2050c9de5b..2556400b10c 100644
--- a/gcc/testsuite/gcc.dg/format/proto.c
+++ b/gcc/testsuite/gcc.dg/format/proto.c
@@ -4,7 +4,7 @@
    without a prototype.  If it's decided that it shouldn't be the tests
    here will need to be adjusted.
    { dg-do compile }
-   { dg-options "-Wall" } */
+   { dg-options "-std=gnu17 -Wall" } */
 
 #define FMT(n1, n2) __attribute__((__format__(__printf__, n1, n2)))
 
diff --git a/gcc/testsuite/gcc.dg/format/sentinel-1.c b/gcc/testsuite/gcc.dg/format/sentinel-1.c
index 16c75a8a961..d51289a1243 100644
--- a/gcc/testsuite/gcc.dg/format/sentinel-1.c
+++ b/gcc/testsuite/gcc.dg/format/sentinel-1.c
@@ -1,7 +1,7 @@
 /* Test for attribute sentinel.  */
 /* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
 /* { dg-do compile } */
-/* { dg-options "-Wformat" } */
+/* { dg-options "-std=gnu17 -Wformat" } */
 
 #include <stddef.h> /* For NULL, which must be (ptr)0.  */
 
diff --git a/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c b/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c
index c8a99a8c707..8fa12e3da36 100644
--- a/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c
@@ -1,5 +1,6 @@
 /* Test parsing of #pragma omp declare simd */
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 #ifdef __aarch64__
 #pragma omp declare simd uniform (a) aligned (b : 2 * sizeof (int)) \
diff --git a/gcc/testsuite/gcc.dg/ifelse-1.c b/gcc/testsuite/gcc.dg/ifelse-1.c
index 2dd2208b01f..cf111e25ef2 100644
--- a/gcc/testsuite/gcc.dg/ifelse-1.c
+++ b/gcc/testsuite/gcc.dg/ifelse-1.c
@@ -1,6 +1,6 @@
 /*
 { dg-do compile }
-{ dg-options "-W -Wall" }
+{ dg-options "-Wno-old-style-definition -W -Wall" }
 */
 
 
diff --git a/gcc/testsuite/gcc.dg/inline-33.c b/gcc/testsuite/gcc.dg/inline-33.c
index 6ce3a5326b8..a8a409d0b77 100644
--- a/gcc/testsuite/gcc.dg/inline-33.c
+++ b/gcc/testsuite/gcc.dg/inline-33.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-optimized"  } */
+/* { dg-options "-std=gnu17 -O3 -fdump-tree-optimized"  } */
 /* { dg-add-options bind_pic_locally } */
 
 int i;
diff --git a/gcc/testsuite/gcc.dg/ipa/inline-5.c b/gcc/testsuite/gcc.dg/ipa/inline-5.c
index 390ba499d67..cef871cc713 100644
--- a/gcc/testsuite/gcc.dg/ipa/inline-5.c
+++ b/gcc/testsuite/gcc.dg/ipa/inline-5.c
@@ -1,6 +1,6 @@
 /* Check statements that are eliminated by inlining.  */
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-ipa-fnsummary-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp"  } */
+/* { dg-options "-std=gnu17 -O2 -fdump-ipa-fnsummary-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp"  } */
 
 struct a {int a,b,c,d,e;};
 void t(int);
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-21.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-21.c
index 67806b866fe..17c1398a11a 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-21.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-21.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 typedef int a;
 typedef int b;
diff --git a/gcc/testsuite/gcc.dg/ipa/pr102714.c b/gcc/testsuite/gcc.dg/ipa/pr102714.c
index 8ab77a61d75..c93496d0ef5 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr102714.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr102714.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-strict-aliasing -fdump-ipa-sra-details -fdump-tree-optimized" } */
+/* { dg-options "-std=gnu17 -O2 -fno-strict-aliasing -fdump-ipa-sra-details -fdump-tree-optimized" } */
 
 typedef _Bool bool;
 
diff --git a/gcc/testsuite/gcc.dg/ipa/pr104813.c b/gcc/testsuite/gcc.dg/ipa/pr104813.c
index 34f413e3823..13e1e06c597 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr104813.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr104813.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3"  } */
+/* { dg-options "-std=gnu17 -O3"  } */
 
 int a, b, c, d, *e;
 void f(int h) {
diff --git a/gcc/testsuite/gcc.dg/ipa/pr108679.c b/gcc/testsuite/gcc.dg/ipa/pr108679.c
index b1ed50bb831..714cdab653a 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr108679.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr108679.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 struct S1 {
   signed f0;
diff --git a/gcc/testsuite/gcc.dg/ipa/pr42706.c b/gcc/testsuite/gcc.dg/ipa/pr42706.c
index 9c5f43af36f..0cb7d512cfb 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr42706.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr42706.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-early-inlining -fipa-sra"  } */
+/* { dg-options "-std=gnu17 -O2 -fno-early-inlining -fipa-sra"  } */
 
 struct S
 {
diff --git a/gcc/testsuite/gcc.dg/ipa/pr88214.c b/gcc/testsuite/gcc.dg/ipa/pr88214.c
index 4daa9829e75..c621796c140 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr88214.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr88214.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-Wno-old-style-definition -O2" } */
 
 void i();
   short a;
diff --git a/gcc/testsuite/gcc.dg/ipa/pr91853.c b/gcc/testsuite/gcc.dg/ipa/pr91853.c
index 4bad7803751..446096894f4 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr91853.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr91853.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "--param ipa-cp-value-list-size=0 -Os -fno-inline" } */
+/* { dg-options "-Wno-old-style-definition --param ipa-cp-value-list-size=0 -Os -fno-inline" } */
 
 struct _wincore
 {
diff --git a/gcc/testsuite/gcc.dg/ipa/pr93763.c b/gcc/testsuite/gcc.dg/ipa/pr93763.c
index aa2e60c5fc7..6aa4c6ea45e 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr93763.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr93763.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3" } */
+/* { dg-options "-std=gnu17 -O3" } */
 
 typedef struct a a;
 struct a {
diff --git a/gcc/testsuite/gcc.dg/ipa/pr96482-2.c b/gcc/testsuite/gcc.dg/ipa/pr96482-2.c
index 54b71ac4fc0..77c34e52726 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr96482-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr96482-2.c
@@ -1,6 +1,6 @@
 /* PR ipa/96482 */
 /* { dg-do compile } */
-/* { dg-options "-O2"  } */
+/* { dg-options "-std=gnu17 -O2"  } */
 
 int i2c_transfer();
 void _dev_err();
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
index 89caea868e6..283aedb1347 100644
--- a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
@@ -1,4 +1,4 @@
-/* { dg-options "-Wno-stringop-overread" } */
+/* { dg-options "-std=gnu17 -Wno-stringop-overread" } */
 
 typedef struct HDC__ { int unused; } *HDC;
 typedef struct HFONT__ { int unused; } *HFONT;
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_2.c b/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
index 0bc940bc1b1..6fb7002fce9 100644
--- a/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
@@ -1,3 +1,4 @@
+/* { dg-options "-std=gnu17" } */
 #include "20091015-1_a.h"
 #include "20091015-1_b.h"
 void foo ();
diff --git a/gcc/testsuite/gcc.dg/lto/pr113197_1.c b/gcc/testsuite/gcc.dg/lto/pr113197_1.c
index 30bf6f7e7c5..000f8422ec4 100644
--- a/gcc/testsuite/gcc.dg/lto/pr113197_1.c
+++ b/gcc/testsuite/gcc.dg/lto/pr113197_1.c
@@ -1,3 +1,4 @@
+/* { dg-options "-std=gnu17" } */
 int a;
 void exit_error();
 void register_dccp() { exit_error(a); }
diff --git a/gcc/testsuite/gcc.dg/lto/pr54702_1.c b/gcc/testsuite/gcc.dg/lto/pr54702_1.c
index c304682e92f..7adc6a37419 100644
--- a/gcc/testsuite/gcc.dg/lto/pr54702_1.c
+++ b/gcc/testsuite/gcc.dg/lto/pr54702_1.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 int *b;
 void *d;
 int c;
diff --git a/gcc/testsuite/gcc.dg/lto/pr99849_0.c b/gcc/testsuite/gcc.dg/lto/pr99849_0.c
index d489cee0f52..5c97a7c75a2 100644
--- a/gcc/testsuite/gcc.dg/lto/pr99849_0.c
+++ b/gcc/testsuite/gcc.dg/lto/pr99849_0.c
@@ -3,7 +3,7 @@
 /* { dg-require-effective-target fpic } */
 /* { dg-require-effective-target shared } */
 /* { dg-extra-ld-options { -shared } } */
-/* { dg-lto-options { { -flto -flto-partition=1to1 -O2 -Wno-incompatible-pointer-types -Wno-discarded-qualifiers -fPIC } } } */
+/* { dg-lto-options { { -std=gnu17 -flto -flto-partition=1to1 -O2 -Wno-incompatible-pointer-types -Wno-discarded-qualifiers -fPIC } } } */
 
 struct { struct A *a; } *b;
 struct B { int *b; };
diff --git a/gcc/testsuite/gcc.dg/noncompile/920923-1.c b/gcc/testsuite/gcc.dg/noncompile/920923-1.c
index 006a07131f9..957fea2db65 100644
--- a/gcc/testsuite/gcc.dg/noncompile/920923-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/920923-1.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-message "undeclared identifier is reported only once" "reminder for mmu_base" { target *-*-* } 0 } */
 typedef BYTE unsigned char;	/* { dg-error "expected" } */
 /* { dg-warning "useless type name in empty declaration" ""  { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c b/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c
index 5f879c3f0ae..cf14acdfa13 100644
--- a/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c
@@ -2,7 +2,7 @@
    accepted.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 void
 f(a)
diff --git a/gcc/testsuite/gcc.dg/noncompile/old-style-parm-3.c b/gcc/testsuite/gcc.dg/noncompile/old-style-parm-3.c
index f9d6d0f686a..6c276cae2f9 100644
--- a/gcc/testsuite/gcc.dg/noncompile/old-style-parm-3.c
+++ b/gcc/testsuite/gcc.dg/noncompile/old-style-parm-3.c
@@ -1,5 +1,6 @@
 /* PR c/71266 */
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 int fn1 (a)
   enum b {  /* { dg-warning "empty declaration" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr30552-2.c b/gcc/testsuite/gcc.dg/noncompile/pr30552-2.c
index d88488397c6..8351f5d8ed8 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr30552-2.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr30552-2.c
@@ -5,7 +5,7 @@
  * internal compiler error.  */
 
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 int main()
 {
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c b/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c
index 23cc7e6b253..0e747be1367 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c
@@ -5,7 +5,7 @@
  * user error, not internal compiler error. */
 
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 int main()
 {
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr71265.c b/gcc/testsuite/gcc.dg/noncompile/pr71265.c
index 9c62aab1233..69507b5ade7 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr71265.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr71265.c
@@ -1,5 +1,6 @@
 /* PR c/71265 */
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 void ID (ID)
   int ID [__func__]; /* { dg-error "size of array .ID. has non-integer type" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr79758-2.c b/gcc/testsuite/gcc.dg/noncompile/pr79758-2.c
index e6a27f952ef..2e5323feb31 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr79758-2.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr79758-2.c
@@ -1,5 +1,6 @@
 /* PR c/79758 */
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 void fn1 (int[a]) { }; /* { dg-error "undeclared here" } */
 void fn1 (b) { }; /* { dg-error "redefinition" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr79758.c b/gcc/testsuite/gcc.dg/noncompile/pr79758.c
index e42a44380fa..eab49250d42 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr79758.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr79758.c
@@ -1,6 +1,6 @@
 /* PR c/79758 */
 /* { dg-do compile } */
-/* { dg-additional-options "-fpermissive" } */
+/* { dg-additional-options "-Wno-old-style-definition -fpermissive" } */
 
 void fn1 (int[a]) { }; /* { dg-error "undeclared here" } */
 void fn1 (b) { }; /* { dg-error "redefinition" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c b/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
index f36a492e53d..3a335364ef3 100644
--- a/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 #include <stdarg.h>
 
 void
diff --git a/gcc/testsuite/gcc.dg/old-style-prom-1.c b/gcc/testsuite/gcc.dg/old-style-prom-1.c
index 165ff982708..f9b41397f84 100644
--- a/gcc/testsuite/gcc.dg/old-style-prom-1.c
+++ b/gcc/testsuite/gcc.dg/old-style-prom-1.c
@@ -1,7 +1,7 @@
 /* Test for prototype followed by old-style definition, as in
    dremf-type-compat-1.c but with a non-built-in function.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 float f (float, float);
 
diff --git a/gcc/testsuite/gcc.dg/old-style-prom-2.c b/gcc/testsuite/gcc.dg/old-style-prom-2.c
index e7e690e1417..4a1283b668d 100644
--- a/gcc/testsuite/gcc.dg/old-style-prom-2.c
+++ b/gcc/testsuite/gcc.dg/old-style-prom-2.c
@@ -1,7 +1,7 @@
 /* Test for prototype followed by old-style definition, as in
    dremf-type-compat-2.c but with a non-built-in function.  */
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
 float f (float, float); /* { dg-warning "prototype declaration" } */
 
diff --git a/gcc/testsuite/gcc.dg/old-style-prom-3.c b/gcc/testsuite/gcc.dg/old-style-prom-3.c
index 720367f2e33..e84b39b90f2 100644
--- a/gcc/testsuite/gcc.dg/old-style-prom-3.c
+++ b/gcc/testsuite/gcc.dg/old-style-prom-3.c
@@ -1,7 +1,7 @@
 /* Test for prototype followed by old-style definition, as in
    dremf-type-compat-3.c but with a non-built-in function.  */
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 float f (float, float); /* { dg-error "prototype declaration" } */
 
diff --git a/gcc/testsuite/gcc.dg/old-style-then-proto-1.c b/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
index e3e61861673..d09e76ec6ee 100644
--- a/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
+++ b/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
@@ -2,7 +2,7 @@
    Mismatched qualifiers used to be wrongly forbidden.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void f1() {}
 void f1(void); /* { dg-warning "prototype for 'f1' follows non-prototype definition" } */
diff --git a/gcc/testsuite/gcc.dg/parm-incomplete-1.c b/gcc/testsuite/gcc.dg/parm-incomplete-1.c
index 02d97b933f4..0c0ae85d86f 100644
--- a/gcc/testsuite/gcc.dg/parm-incomplete-1.c
+++ b/gcc/testsuite/gcc.dg/parm-incomplete-1.c
@@ -6,7 +6,7 @@
    C99 6.7.5.3); the precise rules are unclear.  */
 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 struct s;
 void f (struct s);
diff --git a/gcc/testsuite/gcc.dg/parm-mismatch-1.c b/gcc/testsuite/gcc.dg/parm-mismatch-1.c
index d7621bcd6b2..2136f723ad5 100644
--- a/gcc/testsuite/gcc.dg/parm-mismatch-1.c
+++ b/gcc/testsuite/gcc.dg/parm-mismatch-1.c
@@ -2,7 +2,7 @@
    ().  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void f0(); /* { dg-message "note: previous declaration of 'f0'" "note" } */
 void f0(int, ...); /* { dg-error "conflicting types for 'f0'" } */
diff --git a/gcc/testsuite/gcc.dg/permerror-default.c b/gcc/testsuite/gcc.dg/permerror-default.c
index c674d689081..b321a7d6a20 100644
--- a/gcc/testsuite/gcc.dg/permerror-default.c
+++ b/gcc/testsuite/gcc.dg/permerror-default.c
@@ -1,4 +1,4 @@
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 /* Overview test for C permerrors.  This test should be kept in sync with the
    other permerror-* tests.  If new permerrors are added, test cases should be
diff --git a/gcc/testsuite/gcc.dg/permerror-fpermissive-nowarning.c b/gcc/testsuite/gcc.dg/permerror-fpermissive-nowarning.c
index d07c8636677..19629fc952f 100644
--- a/gcc/testsuite/gcc.dg/permerror-fpermissive-nowarning.c
+++ b/gcc/testsuite/gcc.dg/permerror-fpermissive-nowarning.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fpermissive -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-return-mismatch -Wno-declaration-missing-parameter-type" } */
+/* { dg-options "-std=gnu17 -fpermissive -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-return-mismatch -Wno-declaration-missing-parameter-type" } */
 
 /* This test checks that permerrors can be disabled using -Wno-* options even
    if -fpermissive is used.  */
diff --git a/gcc/testsuite/gcc.dg/permerror-fpermissive.c b/gcc/testsuite/gcc.dg/permerror-fpermissive.c
index fd3020d75ee..46a82001620 100644
--- a/gcc/testsuite/gcc.dg/permerror-fpermissive.c
+++ b/gcc/testsuite/gcc.dg/permerror-fpermissive.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 
 /* Overview test for C permerrors.  This test should be kept in sync with the
    other permerror-* tests.  If new permerrors are added, test cases should be
diff --git a/gcc/testsuite/gcc.dg/permerror-noerror.c b/gcc/testsuite/gcc.dg/permerror-noerror.c
index fc68dfa8bb9..614fb06d6e0 100644
--- a/gcc/testsuite/gcc.dg/permerror-noerror.c
+++ b/gcc/testsuite/gcc.dg/permerror-noerror.c
@@ -1,4 +1,4 @@
-/* { dg-options "-Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=int-conversion -Wno-error=incompatible-pointer-types -Wno-error=return-mismatch -Wno-error=declaration-missing-parameter-type" } */
+/* { dg-options "-std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=int-conversion -Wno-error=incompatible-pointer-types -Wno-error=return-mismatch -Wno-error=declaration-missing-parameter-type" } */
 
 /* This test should emulate the effect of -fpermissive by adding all the
    -Wno-error= options that are implied by -fpermissive.  It needs to be
diff --git a/gcc/testsuite/gcc.dg/permerror-nowarning.c b/gcc/testsuite/gcc.dg/permerror-nowarning.c
index b1cf7990127..3182a2474b0 100644
--- a/gcc/testsuite/gcc.dg/permerror-nowarning.c
+++ b/gcc/testsuite/gcc.dg/permerror-nowarning.c
@@ -1,4 +1,4 @@
-/* { dg-options "-Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-return-mismatch -Wno-declaration-missing-parameter-type" } */
+/* { dg-options "-std=gnu17 -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-return-mismatch -Wno-declaration-missing-parameter-type" } */
 
 /* This test checks that permerrors can be disabled using -Wno-* options.  */
 
diff --git a/gcc/testsuite/gcc.dg/permerror-pedantic.c b/gcc/testsuite/gcc.dg/permerror-pedantic.c
index 2380bb2583c..11fa83a8f78 100644
--- a/gcc/testsuite/gcc.dg/permerror-pedantic.c
+++ b/gcc/testsuite/gcc.dg/permerror-pedantic.c
@@ -1,4 +1,4 @@
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 /* Overview test for C permerrors.  This test should be kept in sync with the
    other permerror-* tests.  If new permerrors are added, test cases should be
diff --git a/gcc/testsuite/gcc.dg/plugin/infoleak-net-ethtool-ioctl.c b/gcc/testsuite/gcc.dg/plugin/infoleak-net-ethtool-ioctl.c
index dce6e44ae13..52846c40f86 100644
--- a/gcc/testsuite/gcc.dg/plugin/infoleak-net-ethtool-ioctl.c
+++ b/gcc/testsuite/gcc.dg/plugin/infoleak-net-ethtool-ioctl.c
@@ -2,7 +2,7 @@
    net/ethtool/ioctl.c  */
 
 /* { dg-do compile } */
-/* { dg-options "-fanalyzer" } */
+/* { dg-options "-std=gnu17 -fanalyzer" } */
 /* { dg-require-effective-target analyzer } */
 
 typedef signed char __s8;
diff --git a/gcc/testsuite/gcc.dg/pointer-array-quals-1.c b/gcc/testsuite/gcc.dg/pointer-array-quals-1.c
index be80912723a..36398ef96f0 100644
--- a/gcc/testsuite/gcc.dg/pointer-array-quals-1.c
+++ b/gcc/testsuite/gcc.dg/pointer-array-quals-1.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* Origin: Martin Uecker <uecker@eecs.berkeley.edu> */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 void tvoid(void* x);
 void transpose0(double* out, const double* in) { }
 void transpose1(double out[2][2], const double in[2][2]) { }
diff --git a/gcc/testsuite/gcc.dg/pointer-array-quals-2.c b/gcc/testsuite/gcc.dg/pointer-array-quals-2.c
index 4c95d8a3a78..32adf79bb7d 100644
--- a/gcc/testsuite/gcc.dg/pointer-array-quals-2.c
+++ b/gcc/testsuite/gcc.dg/pointer-array-quals-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 /* Origin: Martin Uecker <uecker@eecs.berkeley.edu> */
 void tvoid(void* x);
 void transpose0(double* out, const double* in) { }
diff --git a/gcc/testsuite/gcc.dg/pr100791.c b/gcc/testsuite/gcc.dg/pr100791.c
index 00cc4b185a3..f0e7da508de 100644
--- a/gcc/testsuite/gcc.dg/pr100791.c
+++ b/gcc/testsuite/gcc.dg/pr100791.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 
 static inline int __attribute__((__always_inline__))
 foo ()
diff --git a/gcc/testsuite/gcc.dg/pr100843.c b/gcc/testsuite/gcc.dg/pr100843.c
index 695a2ec3f68..a8ecb5a0c85 100644
--- a/gcc/testsuite/gcc.dg/pr100843.c
+++ b/gcc/testsuite/gcc.dg/pr100843.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -w" } */
+/* { dg-options "-std=gnu17 -O1 -w" } */
 
 char c;
 void *memset();
diff --git a/gcc/testsuite/gcc.dg/pr102273.c b/gcc/testsuite/gcc.dg/pr102273.c
index 568e44ebfef..2cb396edc81 100644
--- a/gcc/testsuite/gcc.dg/pr102273.c
+++ b/gcc/testsuite/gcc.dg/pr102273.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-options "-std=gnu17 -ftrivial-auto-var-init=zero" } */
 
 void bar();
 
diff --git a/gcc/testsuite/gcc.dg/pr102385.c b/gcc/testsuite/gcc.dg/pr102385.c
index bdccc9e43b1..f64017ef90c 100644
--- a/gcc/testsuite/gcc.dg/pr102385.c
+++ b/gcc/testsuite/gcc.dg/pr102385.c
@@ -1,4 +1,4 @@
-/* { dg-options "-Wall -Wextra -O2 -fno-toplevel-reorder -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-loop-ivcanon -fpredictive-commoning -fdump-tree-pcom-details-blocks -fdump-tree-lim-details-blocks" } */
+/* { dg-options "-std=gnu17 -Wall -Wextra -O2 -fno-toplevel-reorder -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-loop-ivcanon -fpredictive-commoning -fdump-tree-pcom-details-blocks -fdump-tree-lim-details-blocks" } */
 
 short a, b;
 int c[9];
diff --git a/gcc/testsuite/gcc.dg/pr103222.c b/gcc/testsuite/gcc.dg/pr103222.c
index 2a84437b25d..9b629f2fc91 100644
--- a/gcc/testsuite/gcc.dg/pr103222.c
+++ b/gcc/testsuite/gcc.dg/pr103222.c
@@ -1,5 +1,5 @@
 // { dg-do run }
-// { dg-options "-O2" }
+// { dg-options "-std=gnu17 -O2" }
 
 #include <stdint.h>
 #include <stdio.h>
diff --git a/gcc/testsuite/gcc.dg/pr105140.c b/gcc/testsuite/gcc.dg/pr105140.c
index 173dc8c2fac..32267f04f38 100644
--- a/gcc/testsuite/gcc.dg/pr105140.c
+++ b/gcc/testsuite/gcc.dg/pr105140.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -Os -w -Wno-psabi" } */
+/* { dg-options "-std=gnu17 -fpermissive -Os -w -Wno-psabi" } */
 /* { dg-skip-if "PR105147" { powerpc*-*-* s390*-*-* } } */
 
 typedef char __attribute__((__vector_size__ (16 * sizeof (char)))) U;
diff --git a/gcc/testsuite/gcc.dg/pr105150.c b/gcc/testsuite/gcc.dg/pr105150.c
index 900460c1555..b8c35c08308 100644
--- a/gcc/testsuite/gcc.dg/pr105150.c
+++ b/gcc/testsuite/gcc.dg/pr105150.c
@@ -1,5 +1,5 @@
 /* PR tree-optimization/105150 */
-/* { dg-options "-w -Ofast" } */
+/* { dg-options "-std=gnu17 -w -Ofast" } */
 
 #define A(name) __typeof (__builtin_##name (0)) name (); \
   float name##1 () { return !name (1); } \
diff --git a/gcc/testsuite/gcc.dg/pr105250.c b/gcc/testsuite/gcc.dg/pr105250.c
index c4f4ea0c3d7..ba3b0dd930f 100644
--- a/gcc/testsuite/gcc.dg/pr105250.c
+++ b/gcc/testsuite/gcc.dg/pr105250.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -w -Wno-psabi -O2" } */
+/* { dg-options "-std=gnu17 -fpermissive -w -Wno-psabi -O2" } */
 /* { dg-skip-if "PR105266" { powerpc*-*-* s390*-*-* } } */
 
 typedef int __attribute__((__vector_size__(4))) T;
diff --git a/gcc/testsuite/gcc.dg/pr105972.c b/gcc/testsuite/gcc.dg/pr105972.c
index 73f3385f7eb..93518f60f7f 100644
--- a/gcc/testsuite/gcc.dg/pr105972.c
+++ b/gcc/testsuite/gcc.dg/pr105972.c
@@ -1,6 +1,6 @@
 /* PR c/105972 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -g" } */
+/* { dg-options "-Wno-old-style-definition -O2 -g" } */
 
 __attribute__((optimize (0))) int
 foo (void)
diff --git a/gcc/testsuite/gcc.dg/pr111039.c b/gcc/testsuite/gcc.dg/pr111039.c
index a64c46c7edc..0ba142b0a59 100644
--- a/gcc/testsuite/gcc.dg/pr111039.c
+++ b/gcc/testsuite/gcc.dg/pr111039.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O" } */
+/* { dg-options "-std=gnu17 -O" } */
 
 #if __SIZEOF_INT__ < 4
 #define int __INT32_TYPE__
diff --git a/gcc/testsuite/gcc.dg/pr111407.c b/gcc/testsuite/gcc.dg/pr111407.c
index a171074753f..211e19f899f 100644
--- a/gcc/testsuite/gcc.dg/pr111407.c
+++ b/gcc/testsuite/gcc.dg/pr111407.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/111407*/
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 enum { SEND_TOFILE } __sigsetjmp();
 void fclose();
 void foldergets();
diff --git a/gcc/testsuite/gcc.dg/pr111922.c b/gcc/testsuite/gcc.dg/pr111922.c
index 4f429d741c7..7201c0ef215 100644
--- a/gcc/testsuite/gcc.dg/pr111922.c
+++ b/gcc/testsuite/gcc.dg/pr111922.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-tree-fre" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fno-tree-fre" } */
 
 void f2 (void);
 void f4 (int, int, int);
diff --git a/gcc/testsuite/gcc.dg/pr15236.c b/gcc/testsuite/gcc.dg/pr15236.c
index b01a4e85873..9b92489738d 100644
--- a/gcc/testsuite/gcc.dg/pr15236.c
+++ b/gcc/testsuite/gcc.dg/pr15236.c
@@ -1,7 +1,7 @@
 /* PR 15236: pedantic switch modifies treatment of non-ISO compliant
    enumerations.  */
 /* { dg-do compile } */
-/* { dg-options "-Wall -Wextra -pedantic-errors -Wconversion" } */
+/* { dg-options "-std=gnu17 -Wall -Wextra -pedantic-errors -Wconversion" } */
 typedef enum OMX_ERRORTYPE
 {
   OMX_ErrorNone = 0,
diff --git a/gcc/testsuite/gcc.dg/pr17188-1.c b/gcc/testsuite/gcc.dg/pr17188-1.c
index 522a14f7d75..142f42acdac 100644
--- a/gcc/testsuite/gcc.dg/pr17188-1.c
+++ b/gcc/testsuite/gcc.dg/pr17188-1.c
@@ -3,7 +3,7 @@
    diagnosed.  Bug 17188.  */
 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 struct s0 { }; /* { dg-message "note: originally defined here" } */
 struct s0;
diff --git a/gcc/testsuite/gcc.dg/pr20368-1.c b/gcc/testsuite/gcc.dg/pr20368-1.c
index 4140397c142..2959328e6a6 100644
--- a/gcc/testsuite/gcc.dg/pr20368-1.c
+++ b/gcc/testsuite/gcc.dg/pr20368-1.c
@@ -1,7 +1,7 @@
 /* ICE with -Wstrict-prototypes and typeof an undeclared function.
    Bug 20368.  */
 /* { dg-do compile } */
-/* { dg-options "-Wstrict-prototypes" } */
+/* { dg-options "-std=gnu17 -Wstrict-prototypes" } */
 
 extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */
 
diff --git a/gcc/testsuite/gcc.dg/pr20368-2.c b/gcc/testsuite/gcc.dg/pr20368-2.c
index 7faded6bd8c..3ca5f6363a3 100644
--- a/gcc/testsuite/gcc.dg/pr20368-2.c
+++ b/gcc/testsuite/gcc.dg/pr20368-2.c
@@ -1,7 +1,7 @@
 /* ICE with -Wstrict-prototypes and typeof an undeclared function.
    Bug 20368.  Test with -Wmissing-prototypes.  */
 /* { dg-do compile } */
-/* { dg-options "-Wmissing-prototypes" } */
+/* { dg-options "-std=gnu17 -Wmissing-prototypes" } */
 
 extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */
 
diff --git a/gcc/testsuite/gcc.dg/pr20368-3.c b/gcc/testsuite/gcc.dg/pr20368-3.c
index 0d0ea6dfcc3..e3b5194efa0 100644
--- a/gcc/testsuite/gcc.dg/pr20368-3.c
+++ b/gcc/testsuite/gcc.dg/pr20368-3.c
@@ -1,7 +1,7 @@
 /* ICE with -Wstrict-prototypes and typeof an undeclared function.
    Bug 20368.  Test with -Wmissing-declarations.  */
 /* { dg-do compile } */
-/* { dg-options "-Wmissing-declarations" } */
+/* { dg-options "-std=gnu17 -Wmissing-declarations" } */
 
 extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */
 
diff --git a/gcc/testsuite/gcc.dg/pr27331.c b/gcc/testsuite/gcc.dg/pr27331.c
index 9b5c71e8437..50ec9a1f625 100644
--- a/gcc/testsuite/gcc.dg/pr27331.c
+++ b/gcc/testsuite/gcc.dg/pr27331.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize" } */
+/* { dg-options "-Wno-old-style-definition -O2 -ftree-vectorize" } */
 
 struct funny_match
 {
diff --git a/gcc/testsuite/gcc.dg/pr27861-1.c b/gcc/testsuite/gcc.dg/pr27861-1.c
index 8d6d791bcac..e8f86f289ca 100644
--- a/gcc/testsuite/gcc.dg/pr27861-1.c
+++ b/gcc/testsuite/gcc.dg/pr27861-1.c
@@ -4,7 +4,7 @@
    later producing a VAR_DECL tree whose DECL_RTL's mode didn't match
    the VAR_DECL's type's mode.  */
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 typedef struct sim_state *SIM_DESC;
 typedef enum
diff --git a/gcc/testsuite/gcc.dg/pr28121.c b/gcc/testsuite/gcc.dg/pr28121.c
index 9e306f5930a..93d065fc2c3 100644
--- a/gcc/testsuite/gcc.dg/pr28121.c
+++ b/gcc/testsuite/gcc.dg/pr28121.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 int GetMouseButton ();
 int ParsePos ();
diff --git a/gcc/testsuite/gcc.dg/pr28243.c b/gcc/testsuite/gcc.dg/pr28243.c
index a6d693e224c..fd08b9926fd 100644
--- a/gcc/testsuite/gcc.dg/pr28243.c
+++ b/gcc/testsuite/gcc.dg/pr28243.c
@@ -3,7 +3,7 @@
 
 /* { dg-do compile } */
 /* { dg-require-effective-target fpic } */
-/* { dg-options "-O2 -ftracer -fPIC" } */
+/* { dg-options "-std=gnu17 -O2 -ftracer -fPIC" } */
 
 struct displayfuncs {
   void (*init) ();
diff --git a/gcc/testsuite/gcc.dg/pr28888.c b/gcc/testsuite/gcc.dg/pr28888.c
index 3bad18b9fdf..dea52f1b269 100644
--- a/gcc/testsuite/gcc.dg/pr28888.c
+++ b/gcc/testsuite/gcc.dg/pr28888.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize" } */
+/* { dg-options "-std=gnu17 -O2 -ftree-vectorize" } */
 
 static const unsigned char _c30[] =
   "statistic of allocated integer registers:";
diff --git a/gcc/testsuite/gcc.dg/pr29254.c b/gcc/testsuite/gcc.dg/pr29254.c
index df6ba574a5d..1770a9710b7 100644
--- a/gcc/testsuite/gcc.dg/pr29254.c
+++ b/gcc/testsuite/gcc.dg/pr29254.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -Werror" } */
+/* { dg-options "-std=gnu17 -O3 -Werror" } */
 
 int value_compare ();
 
diff --git a/gcc/testsuite/gcc.dg/pr34457-1.c b/gcc/testsuite/gcc.dg/pr34457-1.c
index 3dca13df093..ef2419f4535 100644
--- a/gcc/testsuite/gcc.dg/pr34457-1.c
+++ b/gcc/testsuite/gcc.dg/pr34457-1.c
@@ -2,7 +2,7 @@
 /* { dg-do link } */
 /* { dg-require-effective-target trampolines } */
 /* { dg-require-effective-target lto } */
-/* { dg-options "-flto -O2" } */
+/* { dg-options "-std=gnu17 -flto -O2" } */
 /* { dg-additional-sources "pr34457-2.c" } */
    
 
diff --git a/gcc/testsuite/gcc.dg/pr36015.c b/gcc/testsuite/gcc.dg/pr36015.c
index fc31535598d..85b441c63c1 100644
--- a/gcc/testsuite/gcc.dg/pr36015.c
+++ b/gcc/testsuite/gcc.dg/pr36015.c
@@ -1,7 +1,7 @@
 /* PR target/36015 */
 /* { dg-do run } */
-/* { dg-options "-O0" } */
-/* { dg-options "-O0 -mregparm=3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-std=gnu17 -O0" } */
+/* { dg-options "-std=gnu17 -O0 -mregparm=3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 static int test ();
 
diff --git a/gcc/testsuite/gcc.dg/pr38245-3.c b/gcc/testsuite/gcc.dg/pr38245-3.c
index 6ef8372a14f..ae687c68efa 100644
--- a/gcc/testsuite/gcc.dg/pr38245-3.c
+++ b/gcc/testsuite/gcc.dg/pr38245-3.c
@@ -1,7 +1,7 @@
 /* PR rtl-optimization/38245 */
 /* { dg-do run } */
 /* { dg-additional-sources "pr38245-4.c" } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 #include "pr38245-3.h"
 
diff --git a/gcc/testsuite/gcc.dg/pr38245-4.c b/gcc/testsuite/gcc.dg/pr38245-4.c
index c9b3d2d8fb8..7b63b989ffa 100644
--- a/gcc/testsuite/gcc.dg/pr38245-4.c
+++ b/gcc/testsuite/gcc.dg/pr38245-4.c
@@ -1,6 +1,6 @@
 /* PR rtl-optimization/38245 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 #include "pr38245-3.h"
 
diff --git a/gcc/testsuite/gcc.dg/pr41241.c b/gcc/testsuite/gcc.dg/pr41241.c
index 42fb2f7e5c7..5364a0a5935 100644
--- a/gcc/testsuite/gcc.dg/pr41241.c
+++ b/gcc/testsuite/gcc.dg/pr41241.c
@@ -1,7 +1,7 @@
 /* PR bootstrap/41241 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -fcompare-debug -g" } */
-/* { dg-options "-O2 -fcompare-debug -g -march=i586 -mtune=i586 -fomit-frame-pointer" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-std=gnu17 -O2 -fcompare-debug -g" } */
+/* { dg-options "-std=gnu17 -O2 -fcompare-debug -g -march=i586 -mtune=i586 -fomit-frame-pointer" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 typedef struct { int t1; int t2; int t3; } *T;
 typedef struct { int s; } S;
diff --git a/gcc/testsuite/gcc.dg/pr43058.c b/gcc/testsuite/gcc.dg/pr43058.c
index bba6f814a71..c1ba39c1242 100644
--- a/gcc/testsuite/gcc.dg/pr43058.c
+++ b/gcc/testsuite/gcc.dg/pr43058.c
@@ -1,6 +1,6 @@
 /* PR debug/43058 */
 /* { dg-do compile } */
-/* { dg-options "-g -O2" } */
+/* { dg-options "-std=gnu17 -g -O2" } */
 /* { dg-timeout-factor 4 } */
 
 extern void *f1 (void *, void *, void *);
diff --git a/gcc/testsuite/gcc.dg/pr44539.c b/gcc/testsuite/gcc.dg/pr44539.c
index 9cfff7a3ae5..cb9a631dead 100644
--- a/gcc/testsuite/gcc.dg/pr44539.c
+++ b/gcc/testsuite/gcc.dg/pr44539.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/44539 */
 /* { dg-do compile } */
-/* { dg-options "-ftracer -freorder-blocks -O2" } */
+/* { dg-options "-std=gnu17 -ftracer -freorder-blocks -O2" } */
 
 void bar (int file);
 extern int baz (void);
diff --git a/gcc/testsuite/gcc.dg/pr45055.c b/gcc/testsuite/gcc.dg/pr45055.c
index 899de50498b..305f8239150 100644
--- a/gcc/testsuite/gcc.dg/pr45055.c
+++ b/gcc/testsuite/gcc.dg/pr45055.c
@@ -1,6 +1,6 @@
 /* PR debug/45055 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftracer -fsched-pressure -funroll-loops -fschedule-insns -fcompare-debug" } */
+/* { dg-options "-std=gnu17 -O2 -ftracer -fsched-pressure -funroll-loops -fschedule-insns -fcompare-debug" } */
 /* { dg-require-effective-target scheduling } */
 
 int colormap[10];
diff --git a/gcc/testsuite/gcc.dg/pr50908.c b/gcc/testsuite/gcc.dg/pr50908.c
index 114dded3ab1..3083a527c30 100644
--- a/gcc/testsuite/gcc.dg/pr50908.c
+++ b/gcc/testsuite/gcc.dg/pr50908.c
@@ -1,6 +1,6 @@
 /* { dg-do compile } */
 /* { dg-require-effective-target lp64 } */
-/* { dg-options "-O2 -ftree-tail-merge" } */
+/* { dg-options "-Wno-old-style-definition -O2 -ftree-tail-merge" } */
 
 enum Lisp_Type
 {
diff --git a/gcc/testsuite/gcc.dg/pr60647-1.c b/gcc/testsuite/gcc.dg/pr60647-1.c
index 99f5919c34c..e5d77f2e52e 100644
--- a/gcc/testsuite/gcc.dg/pr60647-1.c
+++ b/gcc/testsuite/gcc.dg/pr60647-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-Wno-old-style-definition -O2" } */
 
 struct _wincore
 {
diff --git a/gcc/testsuite/gcc.dg/pr63762.c b/gcc/testsuite/gcc.dg/pr63762.c
index df110676eca..8de8e63bfc0 100644
--- a/gcc/testsuite/gcc.dg/pr63762.c
+++ b/gcc/testsuite/gcc.dg/pr63762.c
@@ -1,6 +1,6 @@
 /* PR middle-end/63762 */
 /* { dg-do assemble } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 #include <stdlib.h>
 
diff --git a/gcc/testsuite/gcc.dg/pr63804.c b/gcc/testsuite/gcc.dg/pr63804.c
index f0a02f26ae4..f92822add96 100644
--- a/gcc/testsuite/gcc.dg/pr63804.c
+++ b/gcc/testsuite/gcc.dg/pr63804.c
@@ -1,6 +1,6 @@
 /* PR rtl-optimization/63804 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -g" } */
+/* { dg-options "-std=gnu17 -O2 -g" } */
 
 struct A { int gen; } e;
 int a, d;
diff --git a/gcc/testsuite/gcc.dg/pr68306-3.c b/gcc/testsuite/gcc.dg/pr68306-3.c
index f5a8c102cf8..cac464f492e 100644
--- a/gcc/testsuite/gcc.dg/pr68306-3.c
+++ b/gcc/testsuite/gcc.dg/pr68306-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3" } */
+/* { dg-options "-std=gnu17 -O3" } */
 /* { dg-additional-options "-mno-sse -mno-mmx" { target i?86-*-* x86_64-*-* } } */
 /* { dg-additional-options "-mno-altivec -mno-vsx" { target powerpc*-*-* } } */
 
diff --git a/gcc/testsuite/gcc.dg/pr68533.c b/gcc/testsuite/gcc.dg/pr68533.c
index 49e67a96168..5e9a4c6c991 100644
--- a/gcc/testsuite/gcc.dg/pr68533.c
+++ b/gcc/testsuite/gcc.dg/pr68533.c
@@ -1,6 +1,6 @@
 /* PR c/68533 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 struct T { int t; };
 
diff --git a/gcc/testsuite/gcc.dg/pr69156.c b/gcc/testsuite/gcc.dg/pr69156.c
index 5740971383c..97b46aaa0e8 100644
--- a/gcc/testsuite/gcc.dg/pr69156.c
+++ b/gcc/testsuite/gcc.dg/pr69156.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/69156 */
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -O1 -fno-tree-ccp" } */
+/* { dg-options "-std=gnu17 -fpermissive -O1 -fno-tree-ccp" } */
 
 _Bool
 foo ()
diff --git a/gcc/testsuite/gcc.dg/pr7356-2.c b/gcc/testsuite/gcc.dg/pr7356-2.c
index ad679756978..9bed60d435d 100644
--- a/gcc/testsuite/gcc.dg/pr7356-2.c
+++ b/gcc/testsuite/gcc.dg/pr7356-2.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fdiagnostics-show-caret" } */
+/* { dg-options "-Wno-old-style-definition -fdiagnostics-show-caret" } */
 
 int i /* { dg-error "6: expected ';' before 'int'" } */
 int j;
diff --git a/gcc/testsuite/gcc.dg/pr79983.c b/gcc/testsuite/gcc.dg/pr79983.c
index 1e292d42108..2cf83004b7c 100644
--- a/gcc/testsuite/gcc.dg/pr79983.c
+++ b/gcc/testsuite/gcc.dg/pr79983.c
@@ -1,6 +1,6 @@
 /* PR c/79983 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 struct S;
 struct S { int i; }; /* { dg-message "originally defined here" } */
diff --git a/gcc/testsuite/gcc.dg/pr83463.c b/gcc/testsuite/gcc.dg/pr83463.c
index 9142d273e7c..2af130cf3b0 100644
--- a/gcc/testsuite/gcc.dg/pr83463.c
+++ b/gcc/testsuite/gcc.dg/pr83463.c
@@ -1,7 +1,7 @@
 /* PR middle-end/83463 */
 /* { dg-do compile } */
 /* { dg-prune-output "conflicting types for built-in" } */
-/* { dg-options "-O2 -Wrestrict -Wno-pointer-to-int-cast" } */
+/* { dg-options "-std=gnu17 -O2 -Wrestrict -Wno-pointer-to-int-cast" } */
 
 int *a;
 void *memcpy ();
diff --git a/gcc/testsuite/gcc.dg/pr87347.c b/gcc/testsuite/gcc.dg/pr87347.c
index 2077964e9d3..009f95904fc 100644
--- a/gcc/testsuite/gcc.dg/pr87347.c
+++ b/gcc/testsuite/gcc.dg/pr87347.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Wabsolute-value" } */
+/* { dg-options "-std=gnu17 -Wabsolute-value" } */
 
 int a;
 int abs();
diff --git a/gcc/testsuite/gcc.dg/pr89521-1.c b/gcc/testsuite/gcc.dg/pr89521-1.c
index ebf2c5932c3..282c4f8b5ee 100644
--- a/gcc/testsuite/gcc.dg/pr89521-1.c
+++ b/gcc/testsuite/gcc.dg/pr89521-1.c
@@ -1,6 +1,6 @@
 /* PR c/89521 */
 /* { dg-do compile } */
-/* { dg-options "-Ofast -w" } */
+/* { dg-options "-std=gnu17 -Ofast -w" } */
 
 #define A(name) __typeof (__builtin_##name (0)) name (); long name##1 () { return name (1); }
 #define B(name) A(name) A(name##f) A(name##l)
diff --git a/gcc/testsuite/gcc.dg/pr89521-2.c b/gcc/testsuite/gcc.dg/pr89521-2.c
index 5e37c918fc2..b5ef8860e55 100644
--- a/gcc/testsuite/gcc.dg/pr89521-2.c
+++ b/gcc/testsuite/gcc.dg/pr89521-2.c
@@ -1,6 +1,6 @@
 /* PR c/89521 */
 /* { dg-do compile } */
-/* { dg-options "-Ofast -w" } */
+/* { dg-options "-std=gnu17 -Ofast -w" } */
 
 #define A(name) __typeof (__builtin_##name (0)) name (); \
   float name##1 () { return name (1); } \
diff --git a/gcc/testsuite/gcc.dg/pr90648.c b/gcc/testsuite/gcc.dg/pr90648.c
index bf1fa989478..5a9922d5f87 100644
--- a/gcc/testsuite/gcc.dg/pr90648.c
+++ b/gcc/testsuite/gcc.dg/pr90648.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O" } */
+/* { dg-options "-std=gnu17 -O" } */
 
 extern double copysign ();
 double foo (double x)
diff --git a/gcc/testsuite/gcc.dg/pr93573-1.c b/gcc/testsuite/gcc.dg/pr93573-1.c
index 26ec9b77d6f..50a1c9747a9 100644
--- a/gcc/testsuite/gcc.dg/pr93573-1.c
+++ b/gcc/testsuite/gcc.dg/pr93573-1.c
@@ -1,6 +1,6 @@
 /* PR c/93573 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void bar ();
 
diff --git a/gcc/testsuite/gcc.dg/pr94167.c b/gcc/testsuite/gcc.dg/pr94167.c
index 4b819d3a869..efc87ab03fa 100644
--- a/gcc/testsuite/gcc.dg/pr94167.c
+++ b/gcc/testsuite/gcc.dg/pr94167.c
@@ -1,6 +1,6 @@
 /* PR debug/94167 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -fcompare-debug" } */
+/* { dg-options "-std=gnu17 -O2 -fcompare-debug" } */
 
 struct S { int g, h; signed char i; int j; signed char k; int l[4]; } a, c;
 struct T { signed char g; } e;
diff --git a/gcc/testsuite/gcc.dg/pr94705.c b/gcc/testsuite/gcc.dg/pr94705.c
index 96392ab60ee..6bd92f171e4 100644
--- a/gcc/testsuite/gcc.dg/pr94705.c
+++ b/gcc/testsuite/gcc.dg/pr94705.c
@@ -1,6 +1,6 @@
 /* PR c/94705 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void foo ();
 
diff --git a/gcc/testsuite/gcc.dg/pr95118.c b/gcc/testsuite/gcc.dg/pr95118.c
index 69bc47fd7aa..59173e6c577 100644
--- a/gcc/testsuite/gcc.dg/pr95118.c
+++ b/gcc/testsuite/gcc.dg/pr95118.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-fre" } */
+/* { dg-options "-std=gnu17 -O2 -fdump-tree-fre" } */
 
 void a();
 void b() {
diff --git a/gcc/testsuite/gcc.dg/pr96335.c b/gcc/testsuite/gcc.dg/pr96335.c
index ab243b3d129..a6203f38a03 100644
--- a/gcc/testsuite/gcc.dg/pr96335.c
+++ b/gcc/testsuite/gcc.dg/pr96335.c
@@ -1,6 +1,6 @@
 /* PR middle-end/96335 */
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 void bar (int, void *) __attribute__((__access__(__read_only__, 2)));
 
diff --git a/gcc/testsuite/gcc.dg/pr97830.c b/gcc/testsuite/gcc.dg/pr97830.c
index 3729a65aec2..fd79620e770 100644
--- a/gcc/testsuite/gcc.dg/pr97830.c
+++ b/gcc/testsuite/gcc.dg/pr97830.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 typedef enum { LangC } cLanguage;
 typedef enum { FunctionOneArg, FunctionStandard } cFunctionType;
diff --git a/gcc/testsuite/gcc.dg/pr97882.c b/gcc/testsuite/gcc.dg/pr97882.c
index 48ea93d53c7..6666f898562 100644
--- a/gcc/testsuite/gcc.dg/pr97882.c
+++ b/gcc/testsuite/gcc.dg/pr97882.c
@@ -1,6 +1,6 @@
 /* PR c/97882 - Segmentation Fault on improper redeclaration of function
    { dg-do compile }
-   { dg-options "" } */
+   { dg-options "-std=gnu17" } */
 
 // Check pointer declaration incompatibiliies.
 
diff --git a/gcc/testsuite/gcc.dg/pr99122-2.c b/gcc/testsuite/gcc.dg/pr99122-2.c
index c0c850f141c..3947f7dcdc8 100644
--- a/gcc/testsuite/gcc.dg/pr99122-2.c
+++ b/gcc/testsuite/gcc.dg/pr99122-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -g -w" } */
+/* { dg-options "-std=gnu17 -O2 -g -w" } */
 /* { dg-require-effective-target alloca } */
 
 static int foo ();
diff --git a/gcc/testsuite/gcc.dg/pr99122-3.c b/gcc/testsuite/gcc.dg/pr99122-3.c
index 6a908ad86c0..3e72a303277 100644
--- a/gcc/testsuite/gcc.dg/pr99122-3.c
+++ b/gcc/testsuite/gcc.dg/pr99122-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -g -w" } */
+/* { dg-options "-std=gnu17 -O2 -g -w" } */
 
 static int foo ();
 
diff --git a/gcc/testsuite/gcc.dg/qual-component-1.c b/gcc/testsuite/gcc.dg/qual-component-1.c
index 4eaa71a2d19..f2043ce5144 100644
--- a/gcc/testsuite/gcc.dg/qual-component-1.c
+++ b/gcc/testsuite/gcc.dg/qual-component-1.c
@@ -3,7 +3,7 @@
    union.  Bug 27697 from Frank Victor Fischer.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "-pedantic -Wdiscarded-array-qualifiers" } */
+/* { dg-options "-std=gnu17 -pedantic -Wdiscarded-array-qualifiers" } */
 
 struct s {
   int a;
diff --git a/gcc/testsuite/gcc.dg/sibcall-6.c b/gcc/testsuite/gcc.dg/sibcall-6.c
index 8ee72cac444..c8830b665e9 100644
--- a/gcc/testsuite/gcc.dg/sibcall-6.c
+++ b/gcc/testsuite/gcc.dg/sibcall-6.c
@@ -8,7 +8,7 @@
 
 /* { dg-do run { target epiphany-*-* i?86-*-* x86_64-*-* s390*-*-* } } */
 /* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && { ia32 && { ! nonpic } } } } */
-/* { dg-options "-O2 -foptimize-sibling-calls -fno-ipa-cp" } */
+/* { dg-options "-Wno-old-style-definition -O2 -foptimize-sibling-calls -fno-ipa-cp" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.dg/sms-2.c b/gcc/testsuite/gcc.dg/sms-2.c
index f8375f9f05d..61723141d96 100644
--- a/gcc/testsuite/gcc.dg/sms-2.c
+++ b/gcc/testsuite/gcc.dg/sms-2.c
@@ -2,7 +2,7 @@
    traversal of the loops after versioning.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fmodulo-sched -fdump-rtl-sms" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fmodulo-sched -fdump-rtl-sms" } */
 
 int th, h, em, nlwm, nlwS, nlw, sy;
 void
diff --git a/gcc/testsuite/gcc.dg/tm/20091221.c b/gcc/testsuite/gcc.dg/tm/20091221.c
index 7837243fe5c..655e55cfb24 100644
--- a/gcc/testsuite/gcc.dg/tm/20091221.c
+++ b/gcc/testsuite/gcc.dg/tm/20091221.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-fgnu-tm -fdump-tree-tmedge" } */
+/* { dg-options "-std=gnu17 -fgnu-tm -fdump-tree-tmedge" } */
 
 int i;
 extern void virgin () __attribute__((transaction_pure));
diff --git a/gcc/testsuite/gcc.dg/torture/bfloat16-basic.c b/gcc/testsuite/gcc.dg/torture/bfloat16-basic.c
index 09e54d4470a..20ce60eb7af 100644
--- a/gcc/testsuite/gcc.dg/torture/bfloat16-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/bfloat16-basic.c
@@ -1,6 +1,6 @@
 /* Test __bf16.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options bfloat16 } */
 /* { dg-require-effective-target bfloat16_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float128-basic.c b/gcc/testsuite/gcc.dg/torture/float128-basic.c
index b23d45bf72b..24a22b0eb15 100644
--- a/gcc/testsuite/gcc.dg/torture/float128-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float128-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float128.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float128 } */
 /* { dg-require-effective-target float128_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float128x-basic.c b/gcc/testsuite/gcc.dg/torture/float128x-basic.c
index 75c5a28bb9d..ea80990a617 100644
--- a/gcc/testsuite/gcc.dg/torture/float128x-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float128x-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float128x.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float128x } */
 /* { dg-require-effective-target float128x_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float16-basic.c b/gcc/testsuite/gcc.dg/torture/float16-basic.c
index e94aa203d40..adcbdf936b5 100644
--- a/gcc/testsuite/gcc.dg/torture/float16-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float16-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float16.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float16 } */
 /* { dg-require-effective-target float16_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float32-basic.c b/gcc/testsuite/gcc.dg/torture/float32-basic.c
index 2d3e7a96175..e6b2785bdef 100644
--- a/gcc/testsuite/gcc.dg/torture/float32-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float32-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float32.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float32 } */
 /* { dg-require-effective-target float32_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float32x-basic.c b/gcc/testsuite/gcc.dg/torture/float32x-basic.c
index f2abc332488..b4ca33f6375 100644
--- a/gcc/testsuite/gcc.dg/torture/float32x-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float32x-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float32x.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float32x } */
 /* { dg-require-effective-target float32x_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float64-basic.c b/gcc/testsuite/gcc.dg/torture/float64-basic.c
index decb05f34b2..7e644c31718 100644
--- a/gcc/testsuite/gcc.dg/torture/float64-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float64-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float64.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float64 } */
 /* { dg-require-effective-target float64_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float64x-basic.c b/gcc/testsuite/gcc.dg/torture/float64x-basic.c
index 7a140af0bd7..90dac84bf0b 100644
--- a/gcc/testsuite/gcc.dg/torture/float64x-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float64x-basic.c
@@ -1,6 +1,6 @@
 /* Test _Float64x.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float64x } */
 /* { dg-require-effective-target float64x_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr102762.c b/gcc/testsuite/gcc.dg/torture/pr102762.c
index 67c6b00ccea..d52a970ae39 100644
--- a/gcc/testsuite/gcc.dg/torture/pr102762.c
+++ b/gcc/testsuite/gcc.dg/torture/pr102762.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* We fail to diagnose the invalid __builtin_va_arg_pack use with -flto.  */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr103987.c b/gcc/testsuite/gcc.dg/torture/pr103987.c
index 6bfc76881a1..6fc2eff72ea 100644
--- a/gcc/testsuite/gcc.dg/torture/pr103987.c
+++ b/gcc/testsuite/gcc.dg/torture/pr103987.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 void foo();
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr104825.c b/gcc/testsuite/gcc.dg/torture/pr104825.c
index 7affacc2094..417012e5fdd 100644
--- a/gcc/testsuite/gcc.dg/torture/pr104825.c
+++ b/gcc/testsuite/gcc.dg/torture/pr104825.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-additional-options "-Wno-stringop-overread" } */
+/* { dg-additional-options "-Wno-old-style-definition -Wno-stringop-overread" } */
 
 int foo (fmt)
 char* fmt;
diff --git a/gcc/testsuite/gcc.dg/torture/pr105166.c b/gcc/testsuite/gcc.dg/torture/pr105166.c
index 60e8b73a466..745af50e662 100644
--- a/gcc/testsuite/gcc.dg/torture/pr105166.c
+++ b/gcc/testsuite/gcc.dg/torture/pr105166.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 int bar (foo, a)
   int (**foo) ();
diff --git a/gcc/testsuite/gcc.dg/torture/pr105185.c b/gcc/testsuite/gcc.dg/torture/pr105185.c
index 6ab32360de1..88dee57c5c4 100644
--- a/gcc/testsuite/gcc.dg/torture/pr105185.c
+++ b/gcc/testsuite/gcc.dg/torture/pr105185.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 int foo (fmt)
 char* fmt;
diff --git a/gcc/testsuite/gcc.dg/torture/pr109652.c b/gcc/testsuite/gcc.dg/torture/pr109652.c
index 8a6524d2212..b3d5de9c61e 100644
--- a/gcc/testsuite/gcc.dg/torture/pr109652.c
+++ b/gcc/testsuite/gcc.dg/torture/pr109652.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 typedef int UInt;
 UInt skeletal_RI5_instr;
diff --git a/gcc/testsuite/gcc.dg/torture/pr112444.c b/gcc/testsuite/gcc.dg/torture/pr112444.c
index 61c7ec9b22e..769df6ae6ac 100644
--- a/gcc/testsuite/gcc.dg/torture/pr112444.c
+++ b/gcc/testsuite/gcc.dg/torture/pr112444.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-additional-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-additional-options "-std=gnu17 -ftrivial-auto-var-init=zero" } */
 
 int qmi_message_pbm_get_all_capabilities_output_capability_basic_information_get_printable_message_offset,
     qmi_message_pbm_get_all_capabilities_output_capability_basic_information_get_printable_message_init_offset,
diff --git a/gcc/testsuite/gcc.dg/torture/pr113895-3.c b/gcc/testsuite/gcc.dg/torture/pr113895-3.c
index 255975f3353..d8760e7de54 100644
--- a/gcc/testsuite/gcc.dg/torture/pr113895-3.c
+++ b/gcc/testsuite/gcc.dg/torture/pr113895-3.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 extern void f();
 char a[1][1], b;
diff --git a/gcc/testsuite/gcc.dg/torture/pr24626-2.c b/gcc/testsuite/gcc.dg/torture/pr24626-2.c
index 541c8c5aca4..c6d15ea8a3f 100644
--- a/gcc/testsuite/gcc.dg/torture/pr24626-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr24626-2.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
diff --git a/gcc/testsuite/gcc.dg/torture/pr25183.c b/gcc/testsuite/gcc.dg/torture/pr25183.c
index 84b4c8f8d44..22af72b8dd0 100644
--- a/gcc/testsuite/gcc.dg/torture/pr25183.c
+++ b/gcc/testsuite/gcc.dg/torture/pr25183.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
 enum err {
   err_IO = 0x8a450000, /* { dg-warning "int" } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr38948.c b/gcc/testsuite/gcc.dg/torture/pr38948.c
index 22cef3b356d..01b7213e90f 100644
--- a/gcc/testsuite/gcc.dg/torture/pr38948.c
+++ b/gcc/testsuite/gcc.dg/torture/pr38948.c
@@ -1,4 +1,4 @@
-/* { dg-options "-fno-tree-sra" } */
+/* { dg-options "-std=gnu17 -fno-tree-sra" } */
 typedef unsigned char byte;
 typedef unsigned int uint;
 typedef int bool;
diff --git a/gcc/testsuite/gcc.dg/torture/pr44807.c b/gcc/testsuite/gcc.dg/torture/pr44807.c
index 918333e2563..2230db65410 100644
--- a/gcc/testsuite/gcc.dg/torture/pr44807.c
+++ b/gcc/testsuite/gcc.dg/torture/pr44807.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 int sigemptyset (int *);
 int sigaddset(int, int);
diff --git a/gcc/testsuite/gcc.dg/torture/pr47281.c b/gcc/testsuite/gcc.dg/torture/pr47281.c
index 517e8548e3f..752b472c93e 100644
--- a/gcc/testsuite/gcc.dg/torture/pr47281.c
+++ b/gcc/testsuite/gcc.dg/torture/pr47281.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 struct T;
 typedef void F(void);
diff --git a/gcc/testsuite/gcc.dg/torture/pr47958-1.c b/gcc/testsuite/gcc.dg/torture/pr47958-1.c
index 9fdf142fc99..14feffb9ff9 100644
--- a/gcc/testsuite/gcc.dg/torture/pr47958-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr47958-1.c
@@ -1,4 +1,5 @@
 /* { dg-do assemble } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 void (*foo[6][6]) (int);
 void bar (hdR)
diff --git a/gcc/testsuite/gcc.dg/torture/pr48063.c b/gcc/testsuite/gcc.dg/torture/pr48063.c
index d861bf04c80..ff6960f089c 100644
--- a/gcc/testsuite/gcc.dg/torture/pr48063.c
+++ b/gcc/testsuite/gcc.dg/torture/pr48063.c
@@ -1,6 +1,6 @@
 /* PR tree-optimization/48063 */
 /* { dg-do compile } */
-/* { dg-options "-fno-early-inlining" } */
+/* { dg-options "-std=gnu17 -fno-early-inlining" } */
 
 extern void abort (void);
 static void bar ();
diff --git a/gcc/testsuite/gcc.dg/torture/pr57036-1.c b/gcc/testsuite/gcc.dg/torture/pr57036-1.c
index ac6bc6b9df2..b1cddb10349 100644
--- a/gcc/testsuite/gcc.dg/torture/pr57036-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr57036-1.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 extern void g (void);
 int _setjmp();
diff --git a/gcc/testsuite/gcc.dg/torture/pr57330.c b/gcc/testsuite/gcc.dg/torture/pr57330.c
index 3e6cbcbd28c..362622c6a64 100644
--- a/gcc/testsuite/gcc.dg/torture/pr57330.c
+++ b/gcc/testsuite/gcc.dg/torture/pr57330.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 void foo (int a)
 {}
diff --git a/gcc/testsuite/gcc.dg/torture/pr57584.c b/gcc/testsuite/gcc.dg/torture/pr57584.c
index e4affb2e461..475dabe9a43 100644
--- a/gcc/testsuite/gcc.dg/torture/pr57584.c
+++ b/gcc/testsuite/gcc.dg/torture/pr57584.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target int32plus } */
 /* { dg-require-effective-target label_values } */
 /* { dg-require-effective-target indirect_jumps } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr67741.c b/gcc/testsuite/gcc.dg/torture/pr67741.c
index c0019d04a86..d1a8c251fd7 100644
--- a/gcc/testsuite/gcc.dg/torture/pr67741.c
+++ b/gcc/testsuite/gcc.dg/torture/pr67741.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 struct singlecomplex { float real, imag ; } ;
 struct doublecomplex { double real, imag ; } ;
diff --git a/gcc/testsuite/gcc.dg/torture/pr68104.c b/gcc/testsuite/gcc.dg/torture/pr68104.c
index 5db0282cdc7..8743ecf52bd 100644
--- a/gcc/testsuite/gcc.dg/torture/pr68104.c
+++ b/gcc/testsuite/gcc.dg/torture/pr68104.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 typedef struct
 {
diff --git a/gcc/testsuite/gcc.dg/torture/pr69242.c b/gcc/testsuite/gcc.dg/torture/pr69242.c
index d7f171810b9..2a50a167d1a 100644
--- a/gcc/testsuite/gcc.dg/torture/pr69242.c
+++ b/gcc/testsuite/gcc.dg/torture/pr69242.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-additional-options "-w" } */
+/* { dg-additional-options "-std=gnu17 -w" } */
 
 int a[1];
 void *memcpy();
diff --git a/gcc/testsuite/gcc.dg/torture/pr70457.c b/gcc/testsuite/gcc.dg/torture/pr70457.c
index 74daed4d36f..e0a212f1dbc 100644
--- a/gcc/testsuite/gcc.dg/torture/pr70457.c
+++ b/gcc/testsuite/gcc.dg/torture/pr70457.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 /* This formerly ICEd when trying to expand pow as a built-in with
    the wrong number of arguments.  */
diff --git a/gcc/testsuite/gcc.dg/torture/pr70985.c b/gcc/testsuite/gcc.dg/torture/pr70985.c
index 17273b029a4..36544934850 100644
--- a/gcc/testsuite/gcc.dg/torture/pr70985.c
+++ b/gcc/testsuite/gcc.dg/torture/pr70985.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target int32plus } */
 
 struct
diff --git a/gcc/testsuite/gcc.dg/torture/pr71606.c b/gcc/testsuite/gcc.dg/torture/pr71606.c
index b0cc26ac771..ec7a1102b30 100644
--- a/gcc/testsuite/gcc.dg/torture/pr71606.c
+++ b/gcc/testsuite/gcc.dg/torture/pr71606.c
@@ -1,3 +1,5 @@
+/* { dg-additional-options "-std=gnu17" } */
+
 _Complex a;
 void fn1 ();
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr71816.c b/gcc/testsuite/gcc.dg/torture/pr71816.c
index cc143fa6c7d..5db86b9c104 100644
--- a/gcc/testsuite/gcc.dg/torture/pr71816.c
+++ b/gcc/testsuite/gcc.dg/torture/pr71816.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-prune-output "\\\[-Wbuiltin-declaration-mismatch" } */
 
 void *ext2fs_resize_mem_p;
diff --git a/gcc/testsuite/gcc.dg/torture/pr77286.c b/gcc/testsuite/gcc.dg/torture/pr77286.c
index 0c0610050f1..29d96eb7600 100644
--- a/gcc/testsuite/gcc.dg/torture/pr77286.c
+++ b/gcc/testsuite/gcc.dg/torture/pr77286.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-additional-options "-mavx2" { target x86_64-*-* i?86-*-* } } */
 
 typedef float real;
diff --git a/gcc/testsuite/gcc.dg/torture/pr77646.c b/gcc/testsuite/gcc.dg/torture/pr77646.c
index 1b1990037bf..6366c1be7eb 100644
--- a/gcc/testsuite/gcc.dg/torture/pr77646.c
+++ b/gcc/testsuite/gcc.dg/torture/pr77646.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 struct e {
     int (*f)();
diff --git a/gcc/testsuite/gcc.dg/torture/pr77677-2.c b/gcc/testsuite/gcc.dg/torture/pr77677-2.c
index 768ab12601c..4ba25f0c6fa 100644
--- a/gcc/testsuite/gcc.dg/torture/pr77677-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr77677-2.c
@@ -1,6 +1,6 @@
 /* PR ipa/77677 */
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -w" } */
+/* { dg-options "-std=gnu17 -fpermissive -w" } */
 
 enum machine_mode { MAX_MACHINE_MODE };
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr78365.c b/gcc/testsuite/gcc.dg/torture/pr78365.c
index 5180a0171ae..2588a4826fd 100644
--- a/gcc/testsuite/gcc.dg/torture/pr78365.c
+++ b/gcc/testsuite/gcc.dg/torture/pr78365.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 int a, b, c;
 char d;
diff --git a/gcc/testsuite/gcc.dg/torture/pr79732.c b/gcc/testsuite/gcc.dg/torture/pr79732.c
index ed2695bf267..cfa337cf7a5 100644
--- a/gcc/testsuite/gcc.dg/torture/pr79732.c
+++ b/gcc/testsuite/gcc.dg/torture/pr79732.c
@@ -1,4 +1,5 @@
 /* { dg-do link } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-alias "" } */
 
 int bar () __attribute__ ((alias ("foo")));
diff --git a/gcc/testsuite/gcc.dg/torture/pr80612.c b/gcc/testsuite/gcc.dg/torture/pr80612.c
index e648e82559c..d3f82d306b7 100644
--- a/gcc/testsuite/gcc.dg/torture/pr80612.c
+++ b/gcc/testsuite/gcc.dg/torture/pr80612.c
@@ -1,5 +1,6 @@
 /* PR tree-optimization/80612 */
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 struct obstack *a;
 struct obstack {
diff --git a/gcc/testsuite/gcc.dg/torture/pr80764.c b/gcc/testsuite/gcc.dg/torture/pr80764.c
index bc6d8e87ac3..c8e5655990c 100644
--- a/gcc/testsuite/gcc.dg/torture/pr80764.c
+++ b/gcc/testsuite/gcc.dg/torture/pr80764.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 int b, d, f, h;
 char e;
diff --git a/gcc/testsuite/gcc.dg/torture/pr80842.c b/gcc/testsuite/gcc.dg/torture/pr80842.c
index 600e8ce13ae..2fc4059a109 100644
--- a/gcc/testsuite/gcc.dg/torture/pr80842.c
+++ b/gcc/testsuite/gcc.dg/torture/pr80842.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 unsigned a;
 short b;
diff --git a/gcc/testsuite/gcc.dg/torture/pr81900.c b/gcc/testsuite/gcc.dg/torture/pr81900.c
index 9e4e8f4a7ca..2936f1de4a8 100644
--- a/gcc/testsuite/gcc.dg/torture/pr81900.c
+++ b/gcc/testsuite/gcc.dg/torture/pr81900.c
@@ -1,7 +1,7 @@
 /* PR/81900 */
 /* { dg-do compile } */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
-/* { dg-options "-fdump-tree-optimized" } */
+/* { dg-options "-std=gnu17 -fdump-tree-optimized" } */
 
 void Perl_croak() __attribute__((noreturn));
 char *Perl_sv_gets();
diff --git a/gcc/testsuite/gcc.dg/torture/pr82276.c b/gcc/testsuite/gcc.dg/torture/pr82276.c
index 2f9efc8b914..fc9f2c5a078 100644
--- a/gcc/testsuite/gcc.dg/torture/pr82276.c
+++ b/gcc/testsuite/gcc.dg/torture/pr82276.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 typedef struct a {
   struct a *b;
diff --git a/gcc/testsuite/gcc.dg/torture/pr84803.c b/gcc/testsuite/gcc.dg/torture/pr84803.c
index 81aad626d6c..e9f3783212a 100644
--- a/gcc/testsuite/gcc.dg/torture/pr84803.c
+++ b/gcc/testsuite/gcc.dg/torture/pr84803.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 long a;
 long *b;
diff --git a/gcc/testsuite/gcc.dg/torture/pr93124.c b/gcc/testsuite/gcc.dg/torture/pr93124.c
index 0d361d8c7cf..e654ab83309 100644
--- a/gcc/testsuite/gcc.dg/torture/pr93124.c
+++ b/gcc/testsuite/gcc.dg/torture/pr93124.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-fno-rerun-cse-after-loop -fno-guess-branch-probability -fno-tree-fre" } */
+/* { dg-additional-options "-std=gnu17 -fno-rerun-cse-after-loop -fno-guess-branch-probability -fno-tree-fre" } */
 /* { dg-require-effective-target alloca } */
 
 int x;
diff --git a/gcc/testsuite/gcc.dg/torture/pr97330-1.c b/gcc/testsuite/gcc.dg/torture/pr97330-1.c
index 7dce5bd90d4..8bd20371388 100644
--- a/gcc/testsuite/gcc.dg/torture/pr97330-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr97330-1.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 typedef int a;
 typedef char b;
diff --git a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
index baed1e3fa78..322ebf7f7ba 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
@@ -1,6 +1,6 @@
 /* { dg-require-effective-target freorder } */
 /* { dg-require-effective-target label_values } */
-/* { dg-options "-O2 -freorder-blocks-and-partition" } */
+/* { dg-options "-std=gnu17 -O2 -freorder-blocks-and-partition" } */
 /* { dg-require-stack-size "4000" } */
 
 #include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
index ce50af26a7c..9fa3a88408a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
index 8b7ab985bd3..9910c7902d7 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
 extern void abort (void);
 struct rtx_def;
 typedef struct rtx_def *rtx;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
index 78938f919d4..e228400c97b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O -fdump-tree-dce3" } */
+/* { dg-options "-Wno-old-style-definition -O -fdump-tree-dce3" } */
   
 struct rtx_def;
 typedef struct rtx_def *rtx;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
index 838317de293..2c9920ae039 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
   
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
index 529c79b26e3..11391e6ee6a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-copyprop2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-copyprop2" } */
 
 extern void abort (void);
 extern void blah (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
index 080ccfa8382..c3f75eff29e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
  
 extern void abort (void);
 extern void blah (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
index 7fce5ab4b66..6f3c8c303b7 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-dom2" } */
   
 
 struct rtx_def;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
index 15d7e973041..f5b0a14837e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
   
 
 struct rtx_def;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
index 9f0daac22dc..ad1b8ad791b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
    
 struct rtx_def;
 typedef struct rtx_def *rtx;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
index 9585ff11307..a3b564da368 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
    
 
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
index 7c1fea7dfbb..10ed817d570 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-rtl-expand-details" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-rtl-expand-details" } */
     
 
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c
index 0e01e511b78..939dbaec2ea 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-vrp1" } */
      
 
 extern const unsigned char mode_size[];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
index 6effbb7ffe5..e7e73cb4502 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
 
 extern void abort (void);
 struct rtx_def;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
index bba3569c76f..1097798158a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
                                                                                 
 typedef unsigned int cppchar_t;
 void foo (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c
index e680de8bdee..1453df6eeb0 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-vrp1" } */
      
 
 void
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
index ca06f712890..857191de16e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-vrp1" } */
   
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
index e59b3e346c2..53a2d01763a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
     
 extern void abort (void);
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
index 1b0bef1d3e0..986540ca1bc 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
     
 extern void abort (void);
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
index e4b8d43d299..d147dff6f08 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -fno-tree-fre -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fno-tree-fre -fdump-tree-dom2" } */
 
 extern void abort (void);
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
index 719ea65f5bf..271f0a5760f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
@@ -2,7 +2,7 @@
    references after propagating &equot[0] into p.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O -ftree-dominator-opts" } */
+/* { dg-options "-Wno-old-style-definition -O -ftree-dominator-opts" } */
 
 static unsigned short equot[(6 +3)];
 int
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c
index 11f76671604..5ec48e3da95 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-phiopt1" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-phiopt1" } */
 int
 foo2 (distance, i, j)
      int distance;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c
index 52903dde497..746100836f3 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */ 
-/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-pre-stats" } */
 /* We can't eliminate the *p load here in any sane way, as eshup8 may 
    change it.  */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr111003.c b/gcc/testsuite/gcc.dg/tree-ssa/pr111003.c
index a520765dd9f..59d3a966662 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr111003.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr111003.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-optimized" } */
+/* { dg-options "-std=gnu17 -O3 -fdump-tree-optimized" } */
 
 static int c, d, e, f;
 static short g;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c b/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c
index 14bd4dbd6e5..278843019b2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -w" } */
+/* { dg-options "-std=gnu17 -O3 -w" } */
 
 long XXH3_len_4to8_64b_len, XXH3_len_0to16_64b___trans_tmp_3, XXH3_mix2Accs_acc,
     XXH3_64bits_internal___trans_tmp_8;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr115191.c b/gcc/testsuite/gcc.dg/tree-ssa/pr115191.c
index 43f780aa3b8..fe0c1321883 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr115191.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr115191.c
@@ -1,5 +1,5 @@
 // { dg-do compile }
-// { dg-options "-O1 -w" }
+// { dg-options "-std=gnu17 -O1 -w" }
 
 typedef void *SCM;
 void set_socket_io_ports();
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c b/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c
index 0ce9ed3a620..b749151d503 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 typedef struct
 {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr69666.c b/gcc/testsuite/gcc.dg/tree-ssa/pr69666.c
index 9be77ea1523..220c0cde15b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr69666.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr69666.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -w" } */
+/* { dg-options "-std=gnu17 -O2 -w" } */
 
 int a, c, d;
 float b;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c b/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c
index d636672fddc..6873f87bcce 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -w -fdump-tree-vrp1-details -fdump-tree-vrp2-details -fdump-tree-dom2-details -fdump-tree-dom3-details" } */
+/* { dg-options "-std=gnu17 -O2 -w -fdump-tree-vrp1-details -fdump-tree-vrp2-details -fdump-tree-dom2-details -fdump-tree-dom3-details" } */
 
 /* All the threads found by the threader should have too many
    statements to be profitable.  */
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr79757-1.c b/gcc/testsuite/gcc.dg/ubsan/pr79757-1.c
index ca074bcff46..20ed2cdb93f 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr79757-1.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr79757-1.c
@@ -1,7 +1,7 @@
 /* PR sanitizer/79757 */
 /* { dg-do compile } */
 /* { dg-require-effective-target int128 } */
-/* { dg-options "-fsanitize=undefined" } */
+/* { dg-options "-Wno-old-style-definition -fsanitize=undefined" } */
 
 unsigned __int128 x, y;
 
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr79757-2.c b/gcc/testsuite/gcc.dg/ubsan/pr79757-2.c
index b3e1939a547..32e38c11ef0 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr79757-2.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr79757-2.c
@@ -1,7 +1,7 @@
 /* PR sanitizer/79757 */
 /* { dg-do compile } */
 /* { dg-require-effective-target int128 } */
-/* { dg-options "-fsanitize=undefined" } */
+/* { dg-options "-Wno-old-style-definition -fsanitize=undefined" } */
 
 unsigned __int128 x, y;
 
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr79757-3.c b/gcc/testsuite/gcc.dg/ubsan/pr79757-3.c
index 22fe3deef2d..7eb3fee54ce 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr79757-3.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr79757-3.c
@@ -1,7 +1,7 @@
 /* PR sanitizer/79757 */
 /* { dg-do compile } */
 /* { dg-require-effective-target int128 } */
-/* { dg-options "-fsanitize=undefined" } */
+/* { dg-options "-Wno-old-style-definition -fsanitize=undefined" } */
 
 unsigned __int128 x, y;
 
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr81223.c b/gcc/testsuite/gcc.dg/ubsan/pr81223.c
index e7aff5243e6..f72b1cda809 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr81223.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr81223.c
@@ -1,6 +1,6 @@
 /* PR sanitizer/81223 */
 /* { dg-do compile } */
-/* { dg-options "-fsanitize=undefined" } */
+/* { dg-options "-std=gnu17 -fsanitize=undefined" } */
 
 void bar ();
 
diff --git a/gcc/testsuite/gcc.dg/uninit-10-O0.c b/gcc/testsuite/gcc.dg/uninit-10-O0.c
index f761ac91c41..18fe56cd26c 100644
--- a/gcc/testsuite/gcc.dg/uninit-10-O0.c
+++ b/gcc/testsuite/gcc.dg/uninit-10-O0.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-Wall" } */
+/* { dg-options "-Wno-old-style-definition -Wall" } */
 /* On Alpha EV4, dead code elimination and cfg simplification conspired
    to leave the register containing 'C' marked live, though all references
    to the variable had been removed.  */
diff --git a/gcc/testsuite/gcc.dg/uninit-10.c b/gcc/testsuite/gcc.dg/uninit-10.c
index 0d62020df9f..e2396a5e18a 100644
--- a/gcc/testsuite/gcc.dg/uninit-10.c
+++ b/gcc/testsuite/gcc.dg/uninit-10.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wall" } */
+/* { dg-options "-Wno-old-style-definition -O2 -Wall" } */
 /* On Alpha EV4, dead code elimination and cfg simplification conspired
    to leave the register containing 'C' marked live, though all references
    to the variable had been removed.  */
diff --git a/gcc/testsuite/gcc.dg/uninit-32.c b/gcc/testsuite/gcc.dg/uninit-32.c
index cf9efa0f064..586b6355f43 100644
--- a/gcc/testsuite/gcc.dg/uninit-32.c
+++ b/gcc/testsuite/gcc.dg/uninit-32.c
@@ -1,7 +1,7 @@
 /* PR middle-end/10138 - warn for uninitialized arrays passed as const*
    arguments
    { dg-do compile }
-   { dg-options "-O -Wall" }
+   { dg-options "-std=gnu17 -O -Wall" }
    { dg-require-effective-target alloca } */
 
 typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/uninit-41.c b/gcc/testsuite/gcc.dg/uninit-41.c
index f2e17a81d09..2f138cb8e5c 100644
--- a/gcc/testsuite/gcc.dg/uninit-41.c
+++ b/gcc/testsuite/gcc.dg/uninit-41.c
@@ -1,7 +1,7 @@
 /* Verify that calls to non-modifying built-ins aren't considered
    potentially modifying.
    { dg-do compile }
-   { dg-options "-O2 -Wall" }
+   { dg-options "-std=gnu17 -O2 -Wall" }
    { dg-require-effective-target alloca } */
 
 typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/uninit-A-O0.c b/gcc/testsuite/gcc.dg/uninit-A-O0.c
index 69376911563..c1f1a1cd6c7 100644
--- a/gcc/testsuite/gcc.dg/uninit-A-O0.c
+++ b/gcc/testsuite/gcc.dg/uninit-A-O0.c
@@ -2,7 +2,7 @@
    May be a real bug in CSE. */
 
 /* { dg-do compile } */
-/* { dg-options "-Wall" } */
+/* { dg-options "-Wno-old-style-definition -Wall" } */
 
 struct tree
 {
diff --git a/gcc/testsuite/gcc.dg/uninit-A.c b/gcc/testsuite/gcc.dg/uninit-A.c
index 28f7fe9fcf4..2adc374fbed 100644
--- a/gcc/testsuite/gcc.dg/uninit-A.c
+++ b/gcc/testsuite/gcc.dg/uninit-A.c
@@ -2,7 +2,7 @@
    May be a real bug in CSE. */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wall" } */
+/* { dg-options "-O2 -Wall -Wno-old-style-definition" } */
 
 struct tree
 {
diff --git a/gcc/testsuite/gcc.dg/unused-1.c b/gcc/testsuite/gcc.dg/unused-1.c
index 8db7c2ccfff..2cc86c04faa 100644
--- a/gcc/testsuite/gcc.dg/unused-1.c
+++ b/gcc/testsuite/gcc.dg/unused-1.c
@@ -2,7 +2,7 @@
    egcs-1.1.2 fails, egcs-ss-19990418 passes.
    http://gcc.gnu.org/ml/gcc-bugs/1998-09/msg00199.html */
 /* { dg-do compile } */
-/* { dg-options "-O -Wall -W" } */
+/* { dg-options "-Wno-old-style-definition -O -Wall -W" } */
 int
 f(c)
      char c; /* { dg-warning "unused parameter" "unused parameter warning" } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr114249.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr114249.c
index 64c93cd9a2d..36ccb2c0e94 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pr114249.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr114249.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 enum { SEG_THIN_POOL } read_only;
 struct {
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr97486.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr97486.c
index 17d48a7fe69..fceb93367b6 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pr97486.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr97486.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 struct {
   int *end_info;
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-1.c b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-1.c
index bea3b92ba77..dd3f91be4d2 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-1.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-1.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target vect_int } */
 /* PR tree-optimization/67682.  */
 
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c
index 9431bcb9d5c..2ee50039af3 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target vect_int } */
 /* { dg-require-effective-target vect_perm } */
 /* PR tree-optimization/67682.  */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-3.c b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-3.c
index d1d79125731..1b3d5d99eca 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-3.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-3.c
@@ -1,3 +1,4 @@
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target vect_int } */
 /* { dg-require-effective-target vect_int_mult } */
 /* PR tree-optimization/67682.  */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_111-pr113731.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_111-pr113731.c
index b205f470660..05edf59bec8 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_111-pr113731.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_111-pr113731.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
 /* { dg-require-effective-target vect_long } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_122-pr114239.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_122-pr114239.c
index 7bf4db14209..eea47f73e94 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_122-pr114239.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_122-pr114239.c
@@ -1,4 +1,5 @@
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
 
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c b/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c
index 033c3587f1b..d914b88d731 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c
@@ -6,6 +6,7 @@
    increment by 2 integers at a time, hence the last load needs s[30-33] and
    the penultimate load needs s[28-31].
    This testcase ensures that we do not crash due to that behaviour.  */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target mmap } */
 #include <sys/mman.h>
 #include <stdio.h>
diff --git a/gcc/testsuite/gcc.dg/vla-stexp-2.c b/gcc/testsuite/gcc.dg/vla-stexp-2.c
index 9f1512567f0..8616ef75d09 100644
--- a/gcc/testsuite/gcc.dg/vla-stexp-2.c
+++ b/gcc/testsuite/gcc.dg/vla-stexp-2.c
@@ -1,6 +1,6 @@
 /* PR101838 */
 /* { dg-do run } */
-/* { dg-options "-Wpedantic -O0" } */
+/* { dg-options "-std=gnu17 -Wpedantic -O0" } */
 /* { dg-require-effective-target alloca } */
 
 
diff --git a/gcc/testsuite/gcc.dg/warn-1.c b/gcc/testsuite/gcc.dg/warn-1.c
index 6db4ae5cd6c..d5acca2b9ae 100644
--- a/gcc/testsuite/gcc.dg/warn-1.c
+++ b/gcc/testsuite/gcc.dg/warn-1.c
@@ -1,7 +1,7 @@
 /* The compiler used to say passing arg 0 of, which is wrong.  */
 /* Radar 3069179 */
 
-/* { dg-options "-O3" } */
+/* { dg-options "-Wno-old-style-definition -O3" } */
 
 static void foo (p)
      int p;
diff --git a/gcc/testsuite/gcc.dg/winline-10.c b/gcc/testsuite/gcc.dg/winline-10.c
index 2df5addaebc..f4d92fae8c5 100644
--- a/gcc/testsuite/gcc.dg/winline-10.c
+++ b/gcc/testsuite/gcc.dg/winline-10.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -Winline -fopt-info-optimized-inline=stderr" } */
+/* { dg-options "-Wno-old-style-definition -O2 -Winline -fopt-info-optimized-inline=stderr" } */
 
 struct s { int a; };
 
diff --git a/gcc/testsuite/gcc.dg/wtr-label-1.c b/gcc/testsuite/gcc.dg/wtr-label-1.c
index 78a4d6b0a4b..bd31d925b77 100644
--- a/gcc/testsuite/gcc.dg/wtr-label-1.c
+++ b/gcc/testsuite/gcc.dg/wtr-label-1.c
@@ -2,7 +2,7 @@
    Note, gcc should omit these warnings in system header files.
    Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/24/2000.  */
 /* { dg-do compile } */
-/* { dg-options "-Wtraditional" } */
+/* { dg-options "-Wno-old-style-definition -Wtraditional" } */
 
 enum foo1 { a };
 struct foo2 { int i; };
diff --git a/gcc/testsuite/gcc.dg/wtr-switch-1.c b/gcc/testsuite/gcc.dg/wtr-switch-1.c
index f0381bc5e37..56913ea11a9 100644
--- a/gcc/testsuite/gcc.dg/wtr-switch-1.c
+++ b/gcc/testsuite/gcc.dg/wtr-switch-1.c
@@ -2,7 +2,7 @@
    Note, gcc should omit these warnings in system header files.
    By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000.  */
 /* { dg-do compile } */
-/* { dg-options "-Wtraditional" } */
+/* { dg-options "-Wno-old-style-definition -Wtraditional" } */
 
 void
 testfunc (l)
diff --git a/gcc/testsuite/gcc.target/i386/excess-precision-3.c b/gcc/testsuite/gcc.target/i386/excess-precision-3.c
index e8e9abc6957..06f24894160 100644
--- a/gcc/testsuite/gcc.target/i386/excess-precision-3.c
+++ b/gcc/testsuite/gcc.target/i386/excess-precision-3.c
@@ -1,7 +1,7 @@
 /* Excess precision tests.  Test excess precision is removed when
    necessary.  */
 /* { dg-do run } */
-/* { dg-options "-O2 -mfpmath=387 -fexcess-precision=standard" } */
+/* { dg-options "-Wno-old-style-definition -O2 -mfpmath=387 -fexcess-precision=standard" } */
 
 #include <float.h>
 #include <stdarg.h>
diff --git a/gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c b/gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c
index 385cd950b97..ef0cf41feaa 100644
--- a/gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c
+++ b/gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-require-effective-target fma4 } */
-/* { dg-options "-O2 -mfma4" } */
+/* { dg-options "-std=gnu17 -O2 -mfma4" } */
 
 #include "fma4-check.h"
 
diff --git a/gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c b/gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c
index c0bce417e11..82431ea4614 100644
--- a/gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c
+++ b/gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c
@@ -1,6 +1,6 @@
 /* { dg-do run } */
 /* { dg-require-effective-target fma4 } */
-/* { dg-options "-O0 -mfma4" } */
+/* { dg-options "-std=gnu17 -O0 -mfma4" } */
 
 #include "fma4-check.h"
 
diff --git a/gcc/testsuite/gcc.target/i386/nop-mcount.c b/gcc/testsuite/gcc.target/i386/nop-mcount.c
index a5f8d27fda4..ee3c97f3a57 100644
--- a/gcc/testsuite/gcc.target/i386/nop-mcount.c
+++ b/gcc/testsuite/gcc.target/i386/nop-mcount.c
@@ -1,7 +1,7 @@
 /* Test -mnop-mcount */
 /* { dg-do compile { target { *-*-linux* && nonpic } } } */
 /* { dg-require-effective-target mfentry } */
-/* { dg-options "-pg -mfentry -mrecord-mcount -mnop-mcount" } */
+/* { dg-options "-Wno-old-style-definition -pg -mfentry -mrecord-mcount -mnop-mcount" } */
 /* { dg-final { scan-assembler-not "__fentry__" } } */
 /* Origin: Andi Kleen */
 extern void foobar(char *);
diff --git a/gcc/testsuite/gcc.target/i386/pr102627.c b/gcc/testsuite/gcc.target/i386/pr102627.c
index 8ab9acaf002..7e140923644 100644
--- a/gcc/testsuite/gcc.target/i386/pr102627.c
+++ b/gcc/testsuite/gcc.target/i386/pr102627.c
@@ -1,6 +1,6 @@
 /* PR rtl-optimization/102627 */
 /* { dg-do run } */
-/* { dg-options "-O1" } */
+/* { dg-options "-std=gnu17 -O1" } */
 
 int a, f, l, m, q, c, d, g;
 long b, e;
diff --git a/gcc/testsuite/gcc.target/i386/pr106994.c b/gcc/testsuite/gcc.target/i386/pr106994.c
index 0803311dc75..b0bf9856d19 100644
--- a/gcc/testsuite/gcc.target/i386/pr106994.c
+++ b/gcc/testsuite/gcc.target/i386/pr106994.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-march=skylake -Ofast" } */
+/* { dg-options "-std=gnu17 -march=skylake -Ofast" } */
 
 typedef struct {
   float ymin, ymax;
diff --git a/gcc/testsuite/gcc.target/i386/pr68349.c b/gcc/testsuite/gcc.target/i386/pr68349.c
index 3c38c3a01f3..b8540e4948b 100644
--- a/gcc/testsuite/gcc.target/i386/pr68349.c
+++ b/gcc/testsuite/gcc.target/i386/pr68349.c
@@ -1,6 +1,6 @@
 /* PR target/68483 */
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 int a, b;
 unsigned long my_strlen();
diff --git a/gcc/testsuite/gcc.target/i386/pr97313.c b/gcc/testsuite/gcc.target/i386/pr97313.c
index 711766b4132..6167a1ff075 100644
--- a/gcc/testsuite/gcc.target/i386/pr97313.c
+++ b/gcc/testsuite/gcc.target/i386/pr97313.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O2 -fPIE" } */
+/* { dg-options "-std=gnu17 -O2 -fPIE" } */
 /* { dg-require-effective-target pie } */
 
 typedef struct {
diff --git a/gcc/testsuite/gcc.target/i386/pr99454.c b/gcc/testsuite/gcc.target/i386/pr99454.c
index ba3ffe2cab3..f46d56da0be 100644
--- a/gcc/testsuite/gcc.target/i386/pr99454.c
+++ b/gcc/testsuite/gcc.target/i386/pr99454.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O -w" } */
+/* { dg-options "-std=gnu17 -O -w" } */
 
 struct skb_shared_info {
   short gso_size;
diff --git a/gcc/testsuite/gcc.target/i386/record-mcount.c b/gcc/testsuite/gcc.target/i386/record-mcount.c
index 05b4bcba711..52924e0f214 100644
--- a/gcc/testsuite/gcc.target/i386/record-mcount.c
+++ b/gcc/testsuite/gcc.target/i386/record-mcount.c
@@ -1,6 +1,6 @@
 /* Test -mrecord-mcount */
 /* { dg-do compile { target { *-*-linux* && nonpic } } } */
-/* { dg-options "-pg -mrecord-mcount" } */
+/* { dg-options "-Wno-old-style-definition -pg -mrecord-mcount" } */
 /* { dg-final { scan-assembler "mcount_loc" } } */
 /* Origin: Andi Kleen */
 extern void foobar(char *);
diff --git a/libffi/testsuite/libffi.call/va_struct2.c b/libffi/testsuite/libffi.call/va_struct2.c
index 56f5b9c75fa..49359be712c 100644
--- a/libffi/testsuite/libffi.call/va_struct2.c
+++ b/libffi/testsuite/libffi.call/va_struct2.c
@@ -33,6 +33,7 @@ test_fn (int n, ...)
   struct small_tag s2;
   struct large_tag l;
 
+  (void) n;
   va_start (ap, n);
   s1 = va_arg (ap, struct small_tag);
   l = va_arg (ap, struct large_tag);
diff --git a/libffi/testsuite/libffi.call/va_struct3.c b/libffi/testsuite/libffi.call/va_struct3.c
index 9a27e7fd4a3..c30f9af8894 100644
--- a/libffi/testsuite/libffi.call/va_struct3.c
+++ b/libffi/testsuite/libffi.call/va_struct3.c
@@ -33,6 +33,7 @@ test_fn (int n, ...)
   struct small_tag s2;
   struct large_tag l;
 
+  (void) n;
   va_start (ap, n);
   s1 = va_arg (ap, struct small_tag);
   l = va_arg (ap, struct large_tag);
diff mbox series

Patch

diff --git a/gcc/testsuite/c-c++-common/Wcast-function-type.c b/gcc/testsuite/c-c++-common/Wcast-function-type.c
index b49da486814..38777727151 100644
--- a/gcc/testsuite/c-c++-common/Wcast-function-type.c
+++ b/gcc/testsuite/c-c++-common/Wcast-function-type.c
@@ -1,5 +1,6 @@ 
 /* { dg-do compile } */
-/* { dg-options "-Wcast-function-type" } */
+/* { dg-options "-std=gnu17 -Wcast-function-type" { target c } } */
+/* { dg-options "-Wcast-function-type" { target c++ } } */
 
 int f(long);
 
diff --git a/gcc/testsuite/c-c++-common/Wformat-pr84258.c b/gcc/testsuite/c-c++-common/Wformat-pr84258.c
index d2870a88701..489fd6318e9 100644
--- a/gcc/testsuite/c-c++-common/Wformat-pr84258.c
+++ b/gcc/testsuite/c-c++-common/Wformat-pr84258.c
@@ -1,4 +1,5 @@ 
-/* { dg-options "-Wformat" } */
+/* { dg-options "-std=gnu17 -Wformat" { target c } } */
+/* { dg-options "-Wformat" { target c++ } } */
 
 int main (int argc, char **argv)
 {
diff --git a/gcc/testsuite/c-c++-common/Wvarargs.c b/gcc/testsuite/c-c++-common/Wvarargs.c
index bfd8276a292..4a5c7473af0 100644
--- a/gcc/testsuite/c-c++-common/Wvarargs.c
+++ b/gcc/testsuite/c-c++-common/Wvarargs.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" { target c } } */
 
 #include <stdarg.h>
 
diff --git a/gcc/testsuite/c-c++-common/analyzer/data-model-12.c b/gcc/testsuite/c-c++-common/analyzer/data-model-12.c
index 653b7ad6284..e4a7fbdae44 100644
--- a/gcc/testsuite/c-c++-common/analyzer/data-model-12.c
+++ b/gcc/testsuite/c-c++-common/analyzer/data-model-12.c
@@ -1,4 +1,5 @@ 
 /* Mismatching decl of foo.  */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 
 int foo ();
 
diff --git a/gcc/testsuite/c-c++-common/builtins.c b/gcc/testsuite/c-c++-common/builtins.c
index 527c77e7952..f44d0d3286b 100644
--- a/gcc/testsuite/c-c++-common/builtins.c
+++ b/gcc/testsuite/c-c++-common/builtins.c
@@ -2,7 +2,7 @@ 
    with no prototype do not cause an ICE.
   { dg-do compile }
   { dg-options "-O2 -Wall -Wextra" }
-  { dg-additional-options "-fpermissive" { target c } }
+  { dg-additional-options "-std=gnu17 -fpermissive" { target c } }
   { dg-prune-output "warning" }
   { dg-require-effective-target alloca }  */
 
diff --git a/gcc/testsuite/c-c++-common/pointer-to-fn1.c b/gcc/testsuite/c-c++-common/pointer-to-fn1.c
index 70a5831c958..862ca7ab682 100644
--- a/gcc/testsuite/c-c++-common/pointer-to-fn1.c
+++ b/gcc/testsuite/c-c++-common/pointer-to-fn1.c
@@ -1,6 +1,7 @@ 
 /* PR c++/106937 */
 /* { dg-do compile { target i?86-*-* x86_64-*-* } } */
 /* { dg-options "-fpermissive -fcf-protection" } */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 /* { dg-additional-options "-std=c++11" { target c++ } } */
 /* Test printing a pointer to function with attribute.  */
 
diff --git a/gcc/testsuite/c-c++-common/pragma-diag-17.c b/gcc/testsuite/c-c++-common/pragma-diag-17.c
index a44ce90f98b..93206f0e35b 100644
--- a/gcc/testsuite/c-c++-common/pragma-diag-17.c
+++ b/gcc/testsuite/c-c++-common/pragma-diag-17.c
@@ -1,5 +1,6 @@ 
 /* Test silencing the numeric constant extension pedwarns.  */
 /* { dg-options "-pedantic-errors" } */
+/* { dg-additional-options "-std=gnu17" { target c } } */
 /* { dg-additional-options -fext-numeric-literals { target c++14 } } */
 
 #pragma GCC diagnostic push
diff --git a/gcc/testsuite/c-c++-common/sizeof-array-argument.c b/gcc/testsuite/c-c++-common/sizeof-array-argument.c
index eedfceec2cf..3138edf05a9 100644
--- a/gcc/testsuite/c-c++-common/sizeof-array-argument.c
+++ b/gcc/testsuite/c-c++-common/sizeof-array-argument.c
@@ -1,5 +1,6 @@ 
 /* PR c/6940 */
 /* { dg-do compile } */
+/* { dg-options "-Wno-old-style-definition" { target c } } */
 
 /* Test -Wsizeof-array-argument warning.  */
 
diff --git a/gcc/testsuite/g++.dg/lto/pr54625-1_0.c b/gcc/testsuite/g++.dg/lto/pr54625-1_0.c
index b1455e8c90b..59df1aaf58f 100644
--- a/gcc/testsuite/g++.dg/lto/pr54625-1_0.c
+++ b/gcc/testsuite/g++.dg/lto/pr54625-1_0.c
@@ -1,5 +1,5 @@ 
 /* { dg-lto-do link } */
-/* { dg-lto-options { { -O0 -flto -w } { -O2 -flto -w } }  } */
+/* { dg-lto-options { { -O0 -flto -w -std=gnu17 } { -O2 -flto -w -std=gnu17 } }  } */
 /* { dg-extra-ld-options { -r -nostdlib -flinker-output=nolto-rel } } */
 
 float a;
diff --git a/gcc/testsuite/g++.dg/lto/pr54625-2_0.c b/gcc/testsuite/g++.dg/lto/pr54625-2_0.c
index 1ba463d70e8..b7a53c6bc9a 100644
--- a/gcc/testsuite/g++.dg/lto/pr54625-2_0.c
+++ b/gcc/testsuite/g++.dg/lto/pr54625-2_0.c
@@ -1,5 +1,5 @@ 
 /* { dg-lto-do link } */
-/* { dg-lto-options { { -O0 -flto -w } { -O2 -flto -w } }  } */
+/* { dg-lto-options { { -O0 -flto -w -std=gnu17 } { -O2 -flto -w -std=gnu17 } }  } */
 /* { dg-extra-ld-options { -r -nostdlib -flinker-output=nolto-rel } } */
 
 float a;
diff --git a/gcc/testsuite/gcc.c-torture/compile/20040214-2.c b/gcc/testsuite/gcc.c-torture/compile/20040214-2.c
index 352d5a5d764..cfa97ff28c4 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20040214-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20040214-2.c
@@ -1,4 +1,5 @@ 
 /* http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01307.html */
+/* { dg-options "-std=gnu17" } */
 
 typedef struct xdef xdef;
 struct xdef
diff --git a/gcc/testsuite/gcc.c-torture/compile/921011-2.c b/gcc/testsuite/gcc.c-torture/compile/921011-2.c
index bf11dad979f..85189109618 100644
--- a/gcc/testsuite/gcc.c-torture/compile/921011-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/921011-2.c
@@ -1,3 +1,5 @@ 
+/* { dg-options "-std=gnu17" } */
+
 extern int foobar1 ();
 
 typedef struct
diff --git a/gcc/testsuite/gcc.c-torture/compile/931102-1.c b/gcc/testsuite/gcc.c-torture/compile/931102-1.c
index f60b2799302..2954610341d 100644
--- a/gcc/testsuite/gcc.c-torture/compile/931102-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/931102-1.c
@@ -1,3 +1,5 @@ 
+/* { dg-options "-std=gnu17" } */
+
 char *e ();
 
 #define SET \
diff --git a/gcc/testsuite/gcc.c-torture/compile/990801-1.c b/gcc/testsuite/gcc.c-torture/compile/990801-1.c
index d35ec87b948..d201c9eaa6f 100644
--- a/gcc/testsuite/gcc.c-torture/compile/990801-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/990801-1.c
@@ -1,3 +1,5 @@ 
+/* { dg-options "-std=gnu17" } */
+
 extern int getch();
 extern int class();
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/nested-1.c b/gcc/testsuite/gcc.c-torture/compile/nested-1.c
index 135538a8524..a6b9c391729 100644
--- a/gcc/testsuite/gcc.c-torture/compile/nested-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/nested-1.c
@@ -1,3 +1,4 @@ 
+/* { dg-options "-std=gnu17" } */
 /* { dg-require-effective-target trampolines } */
 
 typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c b/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c
index 593ef96bdb7..4d474ca362c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr100241-1.c
@@ -1,5 +1,6 @@ 
 /* { dg-require-visibility "" } */
-/* { dg-options "-fvisibility=internal -fPIC" { target fpic } } */
+/* { dg-options "-std=gnu17" { target { ! fpic } } } */
+/* { dg-options "-std=gnu17 -fvisibility=internal -fPIC" { target fpic } } */
 
 extern char num_4x4_blocks_high_lookup, num_4x4_blocks_wide_lookup,
     vp9_foreach_transformed_block_in_plane_xd_0_0_0;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr106101.c b/gcc/testsuite/gcc.c-torture/compile/pr106101.c
index e307afcbccc..0115e66c679 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr106101.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr106101.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 extern char *globerr;
 char **ftpglob();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr113616.c b/gcc/testsuite/gcc.c-torture/compile/pr113616.c
index 04c38eadffb..a862e8bd91c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr113616.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr113616.c
@@ -1,5 +1,5 @@ 
 // { dg-do compile }
-// { dg-options "-g" }
+// { dg-options "-std=gnu17 -g" }
 struct A { struct A *a; } foo ();
 struct B { long b; };
 struct C { struct B c; struct A d; } *e;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr47967.c b/gcc/testsuite/gcc.c-torture/compile/pr47967.c
index fe1f9c2ef75..e10f0922424 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr47967.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr47967.c
@@ -1,4 +1,5 @@ 
 /* PR tree-optimization/47967 */
+/* { dg-options "-std=gnu17" } */
 /* { dg-require-effective-target untyped_assembly } */
 
 extern void abort (void);
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr51694.c b/gcc/testsuite/gcc.c-torture/compile/pr51694.c
index 9eddc0bf405..00e6ea378a7 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr51694.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr51694.c
@@ -1,6 +1,6 @@ 
 /* { dg-require-effective-target untyped_assembly } */
 /* { dg-require-effective-target indirect_calls } */
-/* { dg-additional-options "-fpermissive" } */
+/* { dg-additional-options "-std=gnu17 -fpermissive" } */
 
 void
 foo (x, fn)
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr71109.c b/gcc/testsuite/gcc.c-torture/compile/pr71109.c
index b44ba07123e..27a5269e9b5 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr71109.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr71109.c
@@ -1,4 +1,5 @@ 
 /* PR tree-optimization/71109 */
+/* { dg-options "-std=gnu17" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 struct S { int g, h; signed char i; int j; signed char k; int l[4]; } a, c;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c b/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c
index 4718a276bdb..3d49ed817b0 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr83051-2.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-fno-early-inlining" } */
+/* { dg-options "-std=gnu17 -fno-early-inlining" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 void
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c b/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c
index 659925d6c87..b3a4075c1cc 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr89663-1.c
@@ -1,4 +1,5 @@ 
 /* PR middle-end/89663 */
+/* { dg-options "-std=gnu17 -Wno-builtin-declaration-mismatch" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 int irint ();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr94238.c b/gcc/testsuite/gcc.c-torture/compile/pr94238.c
index 5a96a64d85b..8449fd3f75f 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr94238.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr94238.c
@@ -1,3 +1,5 @@ 
+/* { dg-options "-std=gnu17" } */
+
 enum { false, true } a;
 int b, c, d, e, f;
 int fn3();
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr96796.c b/gcc/testsuite/gcc.c-torture/compile/pr96796.c
index debbe62e22f..8deee01237f 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr96796.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr96796.c
@@ -1,4 +1,4 @@ 
-/* { dg-additional-options "-fpermissive -fcommon" } */
+/* { dg-additional-options "-std=gnu17 -fpermissive -fcommon" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 struct S0 {
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr97576.c b/gcc/testsuite/gcc.c-torture/compile/pr97576.c
index d2816132cc0..6768eb86b41 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr97576.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr97576.c
@@ -1,3 +1,4 @@ 
+/* { dg-options "-std=gnu17" } */
 /* { dg-require-effective-target non_strict_prototype } */
 
 void
diff --git a/gcc/testsuite/gcc.c-torture/compile/udivmod4.c b/gcc/testsuite/gcc.c-torture/compile/udivmod4.c
index 9d98a3d575d..5297dc9d2f1 100644
--- a/gcc/testsuite/gcc.c-torture/compile/udivmod4.c
+++ b/gcc/testsuite/gcc.c-torture/compile/udivmod4.c
@@ -1,4 +1,4 @@ 
-/* { dg-additional-options "-fpermissive" } */
+/* { dg-additional-options "-std=gnu17 -fpermissive" } */
 
 long long
 xlrandom ()
diff --git a/gcc/testsuite/gcc.c-torture/execute/20010605-2.c b/gcc/testsuite/gcc.c-torture/execute/20010605-2.c
index 837e0a960d6..ef435bc00ee 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20010605-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20010605-2.c
@@ -1,4 +1,4 @@ 
-/* { dg-additional-options "-fpermissive" } */
+/* { dg-additional-options "-std=gnu17 -fpermissive" } */
 
 void foo (), bar (), baz ();
 int main ()
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020404-1.c b/gcc/testsuite/gcc.c-torture/execute/20020404-1.c
index 53b34083400..18996fd439e 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20020404-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20020404-1.c
@@ -1,4 +1,5 @@ 
 /* { dg-require-effective-target int32plus } */
+/* { dg-options "-std=gnu17" } */
 /* { dg-skip-if "pointers can be truncated" { m32c-*-* } } */
 /* Extracted from GDB sources. */
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030714-1.c b/gcc/testsuite/gcc.c-torture/execute/20030714-1.c
index 719baede26f..18f882a64ee 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20030714-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20030714-1.c
@@ -1,4 +1,5 @@ 
 /* derived from PR optimization/11440  */
+/* { dg-options "-std=gnu17" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/20051012-1.c b/gcc/testsuite/gcc.c-torture/execute/20051012-1.c
index d43aeda8285..1c0f8bd822f 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20051012-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20051012-1.c
@@ -1,3 +1,4 @@ 
+/* { dg-options "-std=gnu17" } */
 /* { dg-require-effective-target untyped_assembly } */
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/20190820-1.c b/gcc/testsuite/gcc.c-torture/execute/20190820-1.c
index 10e48d35750..99c29a981a8 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20190820-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/20190820-1.c
@@ -1,5 +1,6 @@ 
 /* PR rtl-optimization/91347 */
 /* Reported by John David Anglin <danglin@gcc.gnu.org> */
+/* { dg-options "-std=gnu17" } */
 /* { dg-require-effective-target int32plus } */
 
 typedef unsigned short __u16;
diff --git a/gcc/testsuite/gcc.c-torture/execute/920612-1.c b/gcc/testsuite/gcc.c-torture/execute/920612-1.c
index 8553de2c5af..2f369b516f9 100644
--- a/gcc/testsuite/gcc.c-torture/execute/920612-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/920612-1.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-fwrapv" } */
+/* { dg-options "-Wno-old-style-definition -fwrapv" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/930608-1.c b/gcc/testsuite/gcc.c-torture/execute/930608-1.c
index 1f29aa5d07b..fae65fc1b54 100644
--- a/gcc/testsuite/gcc.c-torture/execute/930608-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/930608-1.c
@@ -1,3 +1,5 @@ 
+/* { dg-options "-std=gnu17" } */
+
 void abort (void);
 void exit (int);
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
index 6be63c097ac..be3a29ea8f3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
@@ -1,3 +1,4 @@ 
+/* { dg-options "-std=gnu17" } */
 /* { dg-require-effective-target label_values } */
 /* { dg-require-stack-size "4000" } */
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x
index 84c193fe0e4..ec107bc50c3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-1.x
@@ -13,4 +13,6 @@  if [istarget "arm*-*-vxworks*"] {
     }
 }
 
+lappend additional_flags "-std=gnu17"
+
 return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x
index 84c193fe0e4..ec107bc50c3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-2.x
@@ -13,4 +13,6 @@  if [istarget "arm*-*-vxworks*"] {
     }
 }
 
+lappend additional_flags "-std=gnu17"
+
 return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x
index 84c193fe0e4..ec107bc50c3 100644
--- a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-3.x
@@ -13,4 +13,6 @@  if [istarget "arm*-*-vxworks*"] {
     }
 }
 
+lappend additional_flags "-std=gnu17"
+
 return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.x
new file mode 100644
index 00000000000..9baf8e1cbbb
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4.x
@@ -0,0 +1,2 @@ 
+lappend additional_flags "-std=gnu17"
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.x
new file mode 100644
index 00000000000..9baf8e1cbbb
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4f.x
@@ -0,0 +1,2 @@ 
+lappend additional_flags "-std=gnu17"
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.x b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.x
new file mode 100644
index 00000000000..9baf8e1cbbb
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/fp-cmp-4l.x
@@ -0,0 +1,2 @@ 
+lappend additional_flags "-std=gnu17"
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-9.c b/gcc/testsuite/gcc.c-torture/execute/loop-9.c
index 523057593a3..2b489928983 100644
--- a/gcc/testsuite/gcc.c-torture/execute/loop-9.c
+++ b/gcc/testsuite/gcc.c-torture/execute/loop-9.c
@@ -1,4 +1,5 @@ 
 /* Source: Neil Booth, from PR # 115.  */
+/* { dg-options "-std=gnu17" } */
 
 int false()
 {
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr103209.c b/gcc/testsuite/gcc.c-torture/execute/pr103209.c
index 481689396f4..843b4f0ae69 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr103209.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr103209.c
@@ -1,3 +1,5 @@ 
+/* { dg-options "-std=gnu17" } */
+
 #include <stdio.h>
 #include <stdint.h>
 
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr28289.c b/gcc/testsuite/gcc.c-torture/execute/pr28289.c
index 93e922cbb1f..b5ba296544e 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr28289.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr28289.c
@@ -1,3 +1,5 @@ 
+/* { dg-options "-std=gnu17" } */
+
 extern int ok (int);
 extern void exit ();
 static int gen_x86_64_shrd (int);
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr34982.c b/gcc/testsuite/gcc.c-torture/execute/pr34982.c
index 1500847d0e8..240cf2be115 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr34982.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr34982.c
@@ -1,3 +1,5 @@ 
+/* { dg-options "-std=gnu17" } */
+
 extern void abort (void);
 
 static void something();
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr67037.c b/gcc/testsuite/gcc.c-torture/execute/pr67037.c
index 3119d327b02..af86fa7f956 100644
--- a/gcc/testsuite/gcc.c-torture/execute/pr67037.c
+++ b/gcc/testsuite/gcc.c-torture/execute/pr67037.c
@@ -1,3 +1,5 @@ 
+/* { dg-options "-std=gnu17" } */
+
 long (*extfunc)();
 
 static inline void lstrcpynW( short *d, const short *s, int n )
diff --git a/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c b/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c
index 56f8e14fdde..7000e29d983 100644
--- a/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/va-arg-2.c
@@ -2,6 +2,7 @@ 
    in regs and on the stack.  We test 16 cases, trying to catch multiple
    targets (some use 3 regs for argument passing, some use 12, etc.).
    We test both the arguments and the `lastarg' (the argument to va_start).  */
+/* { dg-options "-std=gnu17" } */
 
 #include <stdarg.h>
 
diff --git a/gcc/testsuite/gcc.dg/20010202-1.c b/gcc/testsuite/gcc.dg/20010202-1.c
index 5f789042eba..418e552cd57 100644
--- a/gcc/testsuite/gcc.dg/20010202-1.c
+++ b/gcc/testsuite/gcc.dg/20010202-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile { target i?86-*-* sparc*-*-* x86_64-*-* } } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.dg/20020430-1.c b/gcc/testsuite/gcc.dg/20020430-1.c
index f48bb672aaf..2690b3835d9 100644
--- a/gcc/testsuite/gcc.dg/20020430-1.c
+++ b/gcc/testsuite/gcc.dg/20020430-1.c
@@ -5,7 +5,7 @@ 
    which left a reference to the deleted ADDR_VEC.  */
 
 /* { dg-do compile { target fpic } } */
-/* { dg-options "-O2 -frename-registers -fpic" } */
+/* { dg-options "-std=gnu17 -O2 -frename-registers -fpic" } */
 /* { dg-skip-if "too many arguments in function call" { bpf-*-* } } */
 
 typedef unsigned long XID;
diff --git a/gcc/testsuite/gcc.dg/20031218-3.c b/gcc/testsuite/gcc.dg/20031218-3.c
index 0bae456b8e7..10f8e775f11 100644
--- a/gcc/testsuite/gcc.dg/20031218-3.c
+++ b/gcc/testsuite/gcc.dg/20031218-3.c
@@ -3,7 +3,7 @@ 
    The problem was that this just to ICE with -O2 -g.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -g" } */
+/* { dg-options "-std=gnu17 -O2 -g" } */
 
 extern __SIZE_TYPE__ strlen (const char *);
 
diff --git a/gcc/testsuite/gcc.dg/20040127-1.c b/gcc/testsuite/gcc.dg/20040127-1.c
index 0ea6062a5a9..3295dee97e3 100644
--- a/gcc/testsuite/gcc.dg/20040127-1.c
+++ b/gcc/testsuite/gcc.dg/20040127-1.c
@@ -5,7 +5,7 @@ 
    floating-point registers on SPARC64.  */
 
 /* { dg-do assemble } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 extern int foo1();
 extern int foo2();
diff --git a/gcc/testsuite/gcc.dg/20041014-1.c b/gcc/testsuite/gcc.dg/20041014-1.c
index 699844074ed..b2e9959616d 100644
--- a/gcc/testsuite/gcc.dg/20041014-1.c
+++ b/gcc/testsuite/gcc.dg/20041014-1.c
@@ -1,6 +1,6 @@ 
 /* PR c/17023 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 void
 f(a, b)
diff --git a/gcc/testsuite/gcc.dg/20041122-1.c b/gcc/testsuite/gcc.dg/20041122-1.c
index b2120f81545..889c7815eb3 100644
--- a/gcc/testsuite/gcc.dg/20041122-1.c
+++ b/gcc/testsuite/gcc.dg/20041122-1.c
@@ -1,6 +1,6 @@ 
 /* PR rtl-optimization/18611 */
 /* { dg-do compile } */
-/* { dg-options "-O1 -fmove-loop-invariants" } */
+/* { dg-options "-std=gnu17 -O1 -fmove-loop-invariants" } */
 
 void dumpCineonChannelInfo ();
 typedef struct {
diff --git a/gcc/testsuite/gcc.dg/20050309-1.c b/gcc/testsuite/gcc.dg/20050309-1.c
index 46b27f82e29..d17bdaf30bc 100644
--- a/gcc/testsuite/gcc.dg/20050309-1.c
+++ b/gcc/testsuite/gcc.dg/20050309-1.c
@@ -3,7 +3,7 @@ 
 
 /* { dg-do compile } */
 /* { dg-require-profiling "-fprofile-generate" } */
-/* { dg-options "-O2 -fprofile-generate" } */
+/* { dg-options "-std=gnu17 -O2 -fprofile-generate" } */
 
 void lookup ();
 int hash ();
diff --git a/gcc/testsuite/gcc.dg/20061026.c b/gcc/testsuite/gcc.dg/20061026.c
index fa8069ce4cf..dbba84eab91 100644
--- a/gcc/testsuite/gcc.dg/20061026.c
+++ b/gcc/testsuite/gcc.dg/20061026.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1" } */
+/* { dg-options "-std=gnu17 -O1" } */
 /* { dg-skip-if "exceeds eBPF stack limit" { bpf-*-* } } */
 
 /* This testcase failed on s390.  The frame size for function f will be
diff --git a/gcc/testsuite/gcc.dg/20101010-1.c b/gcc/testsuite/gcc.dg/20101010-1.c
index 2067012ebcd..d47071742b5 100644
--- a/gcc/testsuite/gcc.dg/20101010-1.c
+++ b/gcc/testsuite/gcc.dg/20101010-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-crossjumping" } */
+/* { dg-options "-std=gnu17 -O2 -fno-crossjumping" } */
 /* { dg-require-effective-target alloca } */
 
 int bar1 ();
diff --git a/gcc/testsuite/gcc.dg/Warray-parameter-10.c b/gcc/testsuite/gcc.dg/Warray-parameter-10.c
index 378f8afbd34..b10a82d0432 100644
--- a/gcc/testsuite/gcc.dg/Warray-parameter-10.c
+++ b/gcc/testsuite/gcc.dg/Warray-parameter-10.c
@@ -1,7 +1,7 @@ 
 /* PR c/102759 - ICE calling a function taking an argument redeclared
    without a prototype.
    { dg-do compile }
-   { dg-options "-Wall" } */
+   { dg-options "-std=gnu17 -Wall" } */
 
 void f (void)
 {
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-2.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-2.c
index 9d75cd8669c..42733cda815 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-2.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-2.c
@@ -1,7 +1,7 @@ 
 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
    without prototype
    { dg-do compile }
-   { dg-options "-Wall -Wextra" } */
+   { dg-options "-std=gnu17 -Wall -Wextra" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-3.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-3.c
index bc652793323..91363ed1de5 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-3.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-3.c
@@ -1,7 +1,7 @@ 
 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
    without prototype
    { dg-do compile }
-   { dg-options "-fpermissive -Wbuiltin-declaration-mismatch" } */
+   { dg-options "-std=gnu17 -fpermissive -Wbuiltin-declaration-mismatch" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
index e845b43c073..c48fe5fcf30 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-4.c
@@ -1,7 +1,7 @@ 
 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
    without prototype
    { dg-do compile }
-   { dg-options "-Wbuiltin-declaration-mismatch" } */
+   { dg-options "-std=gnu17 -Wbuiltin-declaration-mismatch" } */
 
 typedef __PTRDIFF_TYPE__ ptrdiff_t;
 typedef __SIZE_TYPE__    size_t;
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-5.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-5.c
index 9cac9277750..08e677e0605 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-5.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch-5.c
@@ -1,6 +1,6 @@ 
 /* PR testsuite/88098 - FAIL: gcc.dg/Wbuiltin-declaration-mismatch-4.c
    { dg-do compile }
-   { dg-options "-Wbuiltin-declaration-mismatch -fshort-enums" } */
+   { dg-options "-std=gnu17 -Wbuiltin-declaration-mismatch -fshort-enums" } */
 
 int abs ();
 double fabs ();     /* { dg-message "built-in .fabs. declared here" } */
diff --git a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c
index ed66fd3626b..fb456e0421c 100644
--- a/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c
+++ b/gcc/testsuite/gcc.dg/Wbuiltin-declaration-mismatch.c
@@ -1,7 +1,7 @@ 
 /* PR c/83656 - missing -Wbuiltin-declaration-mismatch on declaration
    without prototype
    { dg-do compile }
-   { dg-options "-Wall" } */
+   { dg-options "-std=gnu17 -Wall" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wcxx-compat-2.c b/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
index 4578bece109..938414aee8e 100644
--- a/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
+++ b/gcc/testsuite/gcc.dg/Wcxx-compat-2.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-Wc++-compat" } */
+/* { dg-options "-std=gnu17 -Wc++-compat" } */
 
 _Bool foo;			/* This is okay.  */
 int bool;			/* { dg-warning "5:keyword" } */
diff --git a/gcc/testsuite/gcc.dg/Wdouble-promotion.c b/gcc/testsuite/gcc.dg/Wdouble-promotion.c
index 0ad77915d8a..c002b2ef148 100644
--- a/gcc/testsuite/gcc.dg/Wdouble-promotion.c
+++ b/gcc/testsuite/gcc.dg/Wdouble-promotion.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -Wdouble-promotion" } */
+/* { dg-options "-std=gnu17 -fpermissive -Wdouble-promotion" } */
 
 #include <stddef.h>
 
diff --git a/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c b/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c
index 6116bfa4d8e..52cfbf9ec5d 100644
--- a/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c
+++ b/gcc/testsuite/gcc.dg/Wfree-nonheap-object-7.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wfree-nonheap-object" } */
+/* { dg-options "-std=gnu17 -O2 -Wfree-nonheap-object" } */
 
 struct local_caches *get_local_caches_lcs;
 void *calloc(long, long);
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-1.c b/gcc/testsuite/gcc.dg/Wimplicit-int-1.c
index fc7726c517e..206db40e4cd 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-1.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 
 static l; /* { dg-warning "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-1a.c b/gcc/testsuite/gcc.dg/Wimplicit-int-1a.c
index ef1835e2d3a..0f7880d117f 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-1a.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-1a.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17 " } */
 
 static l; /* { dg-error "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-2.c b/gcc/testsuite/gcc.dg/Wimplicit-int-2.c
index 4ff16f36738..cd2c1ef2441 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-2.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 static l; /* { dg-error "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-3.c b/gcc/testsuite/gcc.dg/Wimplicit-int-3.c
index 654ce736c25..5980c81afb8 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-3.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-3.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors -Wno-implicit-int" } */
+/* { dg-options "-std=gnu17 -pedantic-errors -Wno-implicit-int" } */
 
 static l;
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-4.c b/gcc/testsuite/gcc.dg/Wimplicit-int-4.c
index 99c61a76ecf..28f5da5eed5 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-4.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-4.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -Wno-implicit -Wimplicit-int" } */
+/* { dg-options "-std=gnu17 -fpermissive -Wno-implicit -Wimplicit-int" } */
 
 static l; /* { dg-warning "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wimplicit-int-4a.c b/gcc/testsuite/gcc.dg/Wimplicit-int-4a.c
index 920a088f02b..b507620300a 100644
--- a/gcc/testsuite/gcc.dg/Wimplicit-int-4a.c
+++ b/gcc/testsuite/gcc.dg/Wimplicit-int-4a.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-Wno-implicit -Wimplicit-int" } */
+/* { dg-options "-std=gnu17 -Wno-implicit -Wimplicit-int" } */
 
 static l; /* { dg-error "type defaults to" } */
 
diff --git a/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c b/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c
index 4ae7b1d99ce..4e47a30c234 100644
--- a/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c
+++ b/gcc/testsuite/gcc.dg/Wincompatible-pointer-types-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 void f (int, ...);
 
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-19.c b/gcc/testsuite/gcc.dg/Wrestrict-19.c
index d4750537c55..73b4302fa87 100644
--- a/gcc/testsuite/gcc.dg/Wrestrict-19.c
+++ b/gcc/testsuite/gcc.dg/Wrestrict-19.c
@@ -1,7 +1,7 @@ 
 /* PR middle-end/89934 - ICE on a call with fewer arguments to strncpy
    declared without prototype
    { dg-do compile }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-std=gnu17 -O2 -Wall" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-4.c b/gcc/testsuite/gcc.dg/Wrestrict-4.c
index a95960e751a..e7b62af9cc7 100644
--- a/gcc/testsuite/gcc.dg/Wrestrict-4.c
+++ b/gcc/testsuite/gcc.dg/Wrestrict-4.c
@@ -4,7 +4,7 @@ 
    without a prototype don't cause an ICE.
    { dg-do compile }
    { dg-prune-output "conflicting types for built-in" }
-   { dg-options "-O2 -Warray-bounds -Wrestrict" } */
+   { dg-options "-std=gnu17 -O2 -Warray-bounds -Wrestrict" } */
 
 void* memcpy ();
 void* memmove ();
diff --git a/gcc/testsuite/gcc.dg/Wrestrict-5.c b/gcc/testsuite/gcc.dg/Wrestrict-5.c
index 4ea9176f1f5..00f942335b3 100644
--- a/gcc/testsuite/gcc.dg/Wrestrict-5.c
+++ b/gcc/testsuite/gcc.dg/Wrestrict-5.c
@@ -4,7 +4,7 @@ 
    functions declared with no prototype are checked for overlap, and that
    invalid calls are ignored.
   { dg-do compile }
-  { dg-options "-O2 -fpermissive -Wrestrict" }  */
+  { dg-options "-std=gnu17 -O2 -fpermissive -Wrestrict" }  */
 
 void* memcpy ();
 char* strncpy ();
diff --git a/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c b/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c
index ae2db93c612..260d20c9c9c 100644
--- a/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c
+++ b/gcc/testsuite/gcc.dg/Wstrict-overflow-20.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-fstrict-overflow -O2 -Wstrict-overflow" } */
+/* { dg-options "-std=gnu17 -fstrict-overflow -O2 -Wstrict-overflow" } */
 
 /* Don't warn about an overflow in a copied loop header.  We used to
    get a warning in value numbering.  This is PR 33565.  */
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
index 021eaae335d..2c882909e7f 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-13.c
@@ -3,7 +3,7 @@ 
    PR middle-end/89911 - ICE on a call with no arguments to strnlen
    declared with no prototype
    { dg-do compile }
-   { dg-options "-O2 -fpermissive -Wall" } */
+   { dg-options "-std=gnu17 -O2 -fpermissive -Wall" } */
 
 typedef __SIZE_TYPE__ size_t;
 
diff --git a/gcc/testsuite/gcc.dg/analyzer/doom-d_main-IdentifyVersion.c b/gcc/testsuite/gcc.dg/analyzer/doom-d_main-IdentifyVersion.c
index 982b9b74349..1605047c423 100644
--- a/gcc/testsuite/gcc.dg/analyzer/doom-d_main-IdentifyVersion.c
+++ b/gcc/testsuite/gcc.dg/analyzer/doom-d_main-IdentifyVersion.c
@@ -1,6 +1,6 @@ 
 /* Reduced from Doom's d_main.c, which is under the GPLv2 or later.  */
 
-/* { dg-additional-options "-Wno-analyzer-too-complex" } */
+/* { dg-additional-options "-std=gnu17 -Wno-analyzer-too-complex" } */
 
 typedef __SIZE_TYPE__ size_t;
 typedef struct _IO_FILE FILE;
diff --git a/gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c b/gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c
index fdc21a2bec3..ac0a789a7bb 100644
--- a/gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c
+++ b/gcc/testsuite/gcc.dg/analyzer/doom-s_sound-pr108867.c
@@ -1,6 +1,6 @@ 
 /* Reduced from Doom's linuxdoom-1.10/s_sound.c, which is GPLv2 or later.  */
 
-/* { dg-additional-options "-fno-analyzer-call-summaries -Wno-analyzer-too-complex -Wno-analyzer-symbol-too-complex" } */
+/* { dg-additional-options "-std=gnu17 -fno-analyzer-call-summaries -Wno-analyzer-too-complex -Wno-analyzer-symbol-too-complex" } */
 /* { dg-require-effective-target size32plus } */
 
 typedef struct _IO_FILE FILE;
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
index 7a7320fca2b..1941e49f9e8 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-signed-char.c
@@ -4,7 +4,7 @@ 
    removed.  */
 
 /* { dg-do "compile" } */
-/* { dg-additional-options "-fsigned-char" } */
+/* { dg-additional-options "-Wno-old-style-definition -fsigned-char" } */
 /* { dg-require-effective-target int32plus } */
 
 /* TODO (PR analyzer/112528): remove need for this.  */
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c
index 10832757127..ca7ab132163 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93032-mztools-unsigned-char.c
@@ -4,7 +4,7 @@ 
    removed.  */
 
 /* { dg-do "compile" } */
-/* { dg-additional-options "-funsigned-char" } */
+/* { dg-additional-options "-Wno-old-style-definition -funsigned-char" } */
 /* { dg-require-effective-target int32plus } */
 
 /* TODO (PR analyzer/112528): remove need for this.  */
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c
index 88d0fc1fe43..4ccba46f8da 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93355-localealias.c
@@ -3,7 +3,7 @@ 
    Adapted from intl/localealias.c, with all #includes removed.  */
 
 /* { dg-do "compile" } */
-/* { dg-additional-options "-Wno-analyzer-too-complex" } */
+/* { dg-additional-options "-Wno-old-style-definition -Wno-analyzer-too-complex" } */
 /* TODO: remove the need for this option.  */
 /* { dg-require-effective-target alloca } */
 
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr93375.c b/gcc/testsuite/gcc.dg/analyzer/pr93375.c
index f6108547fb7..34ca68b6417 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr93375.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr93375.c
@@ -1,4 +1,4 @@ 
-/* { dg-additional-options "-Wno-implicit-int" } */
+/* { dg-additional-options "-std=gnu17 -Wno-implicit-int" } */
 
 extern void foo (void *) __attribute__((nonnull));
 
diff --git a/gcc/testsuite/gcc.dg/analyzer/pr94688.c b/gcc/testsuite/gcc.dg/analyzer/pr94688.c
index 8ea8bc3b288..06152d16f06 100644
--- a/gcc/testsuite/gcc.dg/analyzer/pr94688.c
+++ b/gcc/testsuite/gcc.dg/analyzer/pr94688.c
@@ -1,3 +1,4 @@ 
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-skip-if "PR112705" { hppa*64*-*-* } } */
 int a, b;
 void d();
diff --git a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
index c66af927617..ee82bb68243 100644
--- a/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
+++ b/gcc/testsuite/gcc.dg/analyzer/sensitive-1.c
@@ -1,3 +1,5 @@ 
+/* { dg-additional-options "-std=gnu17" } */
+
 #include <stdio.h>
 
 /* Solaris needs this for <unistd.h> to declare getpass.  */
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c
index 4cbf43206dc..f5329d84341 100644
--- a/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/asm-x86-linux-wfx_get_ps_timeout-full.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile { target x86_64-*-* } } */
 /* { dg-require-effective-target lp64 } */
-/* { dg-additional-options "-fsanitize=bounds -fno-analyzer-call-summaries" } */
+/* { dg-additional-options "-std=gnu17 -fsanitize=bounds -fno-analyzer-call-summaries" } */
 /* { dg-skip-if "" { *-*-* } { "-O0" } { "" } } */
 
 /* Reduced from linux kernel: drivers/staging/wfx/sta.c (GPL-2.0)
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/pr104863.c b/gcc/testsuite/gcc.dg/analyzer/torture/pr104863.c
index 30ed4fe022d..6487e966f37 100644
--- a/gcc/testsuite/gcc.dg/analyzer/torture/pr104863.c
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/pr104863.c
@@ -1,4 +1,4 @@ 
-/* { dg-additional-options "-fanalyzer-transitivity" } */
+/* { dg-additional-options "-std=gnu17 -fanalyzer-transitivity" } */
 /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
 
 extern void g();
diff --git a/gcc/testsuite/gcc.dg/analyzer/torture/pr93379.c b/gcc/testsuite/gcc.dg/analyzer/torture/pr93379.c
index 01465cf60e1..6d6ac1433c8 100644
--- a/gcc/testsuite/gcc.dg/analyzer/torture/pr93379.c
+++ b/gcc/testsuite/gcc.dg/analyzer/torture/pr93379.c
@@ -1,2 +1,3 @@ 
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 #include "../../torture/pr57330.c"
diff --git a/gcc/testsuite/gcc.dg/array-quals-2.c b/gcc/testsuite/gcc.dg/array-quals-2.c
index 7f33e3fb2ce..e49330d54a4 100644
--- a/gcc/testsuite/gcc.dg/array-quals-2.c
+++ b/gcc/testsuite/gcc.dg/array-quals-2.c
@@ -3,7 +3,7 @@ 
    lost in forming composite types.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "-pedantic -Wno-discarded-array-qualifiers" } */
+/* { dg-options "-std=gnu17 -pedantic -Wno-discarded-array-qualifiers" } */
 typedef const char T[1];
 typedef const char T2[1];
 typedef volatile char U[1];
diff --git a/gcc/testsuite/gcc.dg/attr-invalid.c b/gcc/testsuite/gcc.dg/attr-invalid.c
index a3315fa131b..87f3cbcfa90 100644
--- a/gcc/testsuite/gcc.dg/attr-invalid.c
+++ b/gcc/testsuite/gcc.dg/attr-invalid.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 #define CONCAT_(A,B) A ## B
 #define CONCAT(A,B) CONCAT_(A,B)
diff --git a/gcc/testsuite/gcc.dg/auto-init-uninit-A.c b/gcc/testsuite/gcc.dg/auto-init-uninit-A.c
index 0ef1d92a747..8347a6081e5 100644
--- a/gcc/testsuite/gcc.dg/auto-init-uninit-A.c
+++ b/gcc/testsuite/gcc.dg/auto-init-uninit-A.c
@@ -2,6 +2,6 @@ 
    May be a real bug in CSE. */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wall -ftrivial-auto-var-init=zero" } */
+/* { dg-options "-O2 -Wall -Wno-old-style-definition -ftrivial-auto-var-init=zero" } */
 
 #include "uninit-A.c"
diff --git a/gcc/testsuite/gcc.dg/builtin-choose-expr.c b/gcc/testsuite/gcc.dg/builtin-choose-expr.c
index ceac6051f78..e8c14b4f4b7 100644
--- a/gcc/testsuite/gcc.dg/builtin-choose-expr.c
+++ b/gcc/testsuite/gcc.dg/builtin-choose-expr.c
@@ -35,7 +35,7 @@ 
 
 
 extern void abort ();
-extern void exit ();
+extern void exit (int);
 
 void bad ()
 {
diff --git a/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c b/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c
index 9016ec742be..de764e3776a 100644
--- a/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c
+++ b/gcc/testsuite/gcc.dg/builtin-tgmath-err-1.c
@@ -1,7 +1,7 @@ 
 /* Test __builtin_tgmath: errors that indicate a bad definition of a
    type-generic macro rather than bad arguments in a call to it.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void *p;
 double d;
diff --git a/gcc/testsuite/gcc.dg/builtins-30.c b/gcc/testsuite/gcc.dg/builtins-30.c
index 37e5dba2db6..d6552e5bdcb 100644
--- a/gcc/testsuite/gcc.dg/builtins-30.c
+++ b/gcc/testsuite/gcc.dg/builtins-30.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-Wall -Wshadow -fshow-column" } */
+/* { dg-options "-std=gnu17 -Wall -Wshadow -fshow-column" } */
 
 extern double strtod (const char *, char **);
 #define UNUSED __attribute__ ((unused))
diff --git a/gcc/testsuite/gcc.dg/cast-function-1.c b/gcc/testsuite/gcc.dg/cast-function-1.c
index 5228b559165..4bd713611fe 100644
--- a/gcc/testsuite/gcc.dg/cast-function-1.c
+++ b/gcc/testsuite/gcc.dg/cast-function-1.c
@@ -6,7 +6,7 @@ 
    prototype than the actual one.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O3" } */
+/* { dg-options "-std=gnu17 -O3" } */
 
 int foo1(int);
 int foo2();
diff --git a/gcc/testsuite/gcc.dg/cleanup-1.c b/gcc/testsuite/gcc.dg/cleanup-1.c
index c622a62a4ad..22d590087c6 100644
--- a/gcc/testsuite/gcc.dg/cleanup-1.c
+++ b/gcc/testsuite/gcc.dg/cleanup-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -Wall" } */
+/* { dg-options "-std=gnu17 -fpermissive -Wall" } */
 /* Validate expected warnings and errors.  */
 
 #define U	__attribute__((unused))
diff --git a/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c b/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c
index 0c672394870..ff567a5dd9b 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-complex-1_x.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O -Wno-psabi" } */
+/* { dg-options "-std=gnu17 -O -Wno-psabi" } */
 
 
 #ifdef __x86_64__
diff --git a/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c b/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c
index 2fb9826eb0f..4ad5339ff91 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-complex-2_x.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O -Wno-psabi" } */
+/* { dg-options "-std=gnu17 -O -Wno-psabi" } */
 
 
 #ifdef __x86_64__
diff --git a/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c b/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c
index 1f92303d95b..13044bd9706 100644
--- a/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c
+++ b/gcc/testsuite/gcc.dg/compat/union-m128-1_x.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-O -msse2" } */
+/* { dg-options "-std=gnu17 -O -msse2" } */
 
 #include "union-m128-1.h"
 
diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr66482.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr66482.c
index 880791c72d4..81fac10b5bf 100644
--- a/gcc/testsuite/gcc.dg/debug/dwarf2/pr66482.c
+++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr66482.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O3 -gdwarf" } */
+/* { dg-options "-std=gnu17 -O3 -gdwarf" } */
 
 void f(int p) {}
 int g() {
diff --git a/gcc/testsuite/gcc.dg/dfp/composite-type-2.c b/gcc/testsuite/gcc.dg/dfp/composite-type-2.c
index 5c6d95cc200..3ae8a245f24 100644
--- a/gcc/testsuite/gcc.dg/dfp/composite-type-2.c
+++ b/gcc/testsuite/gcc.dg/dfp/composite-type-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O -Wall -ftrack-macro-expansion=0" } */
+/* { dg-options "-std=gnu17 -O -Wall -ftrack-macro-expansion=0" } */
 
 /* C99 6.2.7: Compatible type and composite type.  */
 
diff --git a/gcc/testsuite/gcc.dg/dfp/composite-type.c b/gcc/testsuite/gcc.dg/dfp/composite-type.c
index 2eb601400b5..ead335168d3 100644
--- a/gcc/testsuite/gcc.dg/dfp/composite-type.c
+++ b/gcc/testsuite/gcc.dg/dfp/composite-type.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -O -Wall -ftrack-macro-expansion=0" } */
+/* { dg-options "-std=gnu17 -fpermissive -O -Wall -ftrack-macro-expansion=0" } */
 
 /* C99 6.2.7: Compatible type and composite type.  */
 
diff --git a/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c b/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c
index bca51066be3..5740e024fb2 100644
--- a/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c
+++ b/gcc/testsuite/gcc.dg/dfp/keywords-pedantic.c
@@ -1,7 +1,7 @@ 
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
-/* Decimal float is a GCC extension.  */
+/* Decimal float is a GCC extension before C23.  */
 
 _Decimal32 x;		/* { dg-warning "GCC extension|ISO C" } */
 _Decimal64 y;		/* { dg-warning "GCC extension|ISO C" } */
diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-1.c b/gcc/testsuite/gcc.dg/dremf-type-compat-1.c
index 79c55ef840c..79e5d5b5d8c 100644
--- a/gcc/testsuite/gcc.dg/dremf-type-compat-1.c
+++ b/gcc/testsuite/gcc.dg/dremf-type-compat-1.c
@@ -4,7 +4,7 @@ 
    so it should be permitted when the function is built in.  Bug
    16666.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 float dremf (float, float);
 
diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-2.c b/gcc/testsuite/gcc.dg/dremf-type-compat-2.c
index 980ead187e7..ffb56a73b91 100644
--- a/gcc/testsuite/gcc.dg/dremf-type-compat-2.c
+++ b/gcc/testsuite/gcc.dg/dremf-type-compat-2.c
@@ -5,7 +5,7 @@ 
    16666.  Test with -pedantic, where the problem should still be
    diagnosed.  */
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
 float dremf (float, float); /* { dg-warning "prototype declaration" } */
 
diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-3.c b/gcc/testsuite/gcc.dg/dremf-type-compat-3.c
index 3934a64e19f..ef36e0b6b12 100644
--- a/gcc/testsuite/gcc.dg/dremf-type-compat-3.c
+++ b/gcc/testsuite/gcc.dg/dremf-type-compat-3.c
@@ -5,7 +5,7 @@ 
    16666.  Test with -pedantic-errors, where the problem should still
    be diagnosed.  */
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 float dremf (float, float); /* { dg-error "prototype declaration" } */
 
diff --git a/gcc/testsuite/gcc.dg/dremf-type-compat-4.c b/gcc/testsuite/gcc.dg/dremf-type-compat-4.c
index b3a2c5ad5d7..27e2204ecff 100644
--- a/gcc/testsuite/gcc.dg/dremf-type-compat-4.c
+++ b/gcc/testsuite/gcc.dg/dremf-type-compat-4.c
@@ -3,7 +3,7 @@ 
    of old-style parameter declarations should only apply when the
    prototype is visible, not for a built-in prototype.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 float
 dremf(x, y) /* { dg-warning "conflicting types for built-in function 'dremf'" } */
diff --git a/gcc/testsuite/gcc.dg/enum-compat-1.c b/gcc/testsuite/gcc.dg/enum-compat-1.c
index b7352f6ddc3..15890677b6d 100644
--- a/gcc/testsuite/gcc.dg/enum-compat-1.c
+++ b/gcc/testsuite/gcc.dg/enum-compat-1.c
@@ -3,7 +3,7 @@ 
 /* Origin: Joseph Myers <jsm@polyomino.org.uk>, based on
    PR c/6024 from Richard Earnshaw <rearnsha@arm.com> */
 /* { dg-do compile } */
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 
 /* Original test from PR c/6024.  */
 enum e1 {a, b};
diff --git a/gcc/testsuite/gcc.dg/enum-compat-2.c b/gcc/testsuite/gcc.dg/enum-compat-2.c
index 69509012480..b42717e5939 100644
--- a/gcc/testsuite/gcc.dg/enum-compat-2.c
+++ b/gcc/testsuite/gcc.dg/enum-compat-2.c
@@ -3,7 +3,7 @@ 
 /* Origin: Joseph Myers <jsm@polyomino.org.uk>, based on
    PR c/6024 from Richard Earnshaw <rearnsha@arm.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 /* Original test from PR c/6024.  */
 enum e1 {a, b};
diff --git a/gcc/testsuite/gcc.dg/floatn-errs.c b/gcc/testsuite/gcc.dg/floatn-errs.c
index 0dcc2f1bb97..9fb3f90262c 100644
--- a/gcc/testsuite/gcc.dg/floatn-errs.c
+++ b/gcc/testsuite/gcc.dg/floatn-errs.c
@@ -1,6 +1,6 @@ 
 /* Tests for _FloatN / _FloatNx types: test erroneous code.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 /* { dg-add-options float32 } */
 /* { dg-add-options float64 } */
 /* { dg-add-options float32x } */
diff --git a/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c b/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
index 6ff3091ce6a..b395fbdf7ca 100644
--- a/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
+++ b/gcc/testsuite/gcc.dg/fltconst-pedantic-dfp.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
 double a = 1.dl;	/* { dg-warning "decimal float" } */
 /* { dg-error "not supported for this target" "not supported" { target { ! dfp } } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/format/proto.c b/gcc/testsuite/gcc.dg/format/proto.c
index b2050c9de5b..2556400b10c 100644
--- a/gcc/testsuite/gcc.dg/format/proto.c
+++ b/gcc/testsuite/gcc.dg/format/proto.c
@@ -4,7 +4,7 @@ 
    without a prototype.  If it's decided that it shouldn't be the tests
    here will need to be adjusted.
    { dg-do compile }
-   { dg-options "-Wall" } */
+   { dg-options "-std=gnu17 -Wall" } */
 
 #define FMT(n1, n2) __attribute__((__format__(__printf__, n1, n2)))
 
diff --git a/gcc/testsuite/gcc.dg/format/sentinel-1.c b/gcc/testsuite/gcc.dg/format/sentinel-1.c
index 16c75a8a961..d51289a1243 100644
--- a/gcc/testsuite/gcc.dg/format/sentinel-1.c
+++ b/gcc/testsuite/gcc.dg/format/sentinel-1.c
@@ -1,7 +1,7 @@ 
 /* Test for attribute sentinel.  */
 /* Origin: Kaveh Ghazi <ghazi@caip.rutgers.edu> */
 /* { dg-do compile } */
-/* { dg-options "-Wformat" } */
+/* { dg-options "-std=gnu17 -Wformat" } */
 
 #include <stddef.h> /* For NULL, which must be (ptr)0.  */
 
diff --git a/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c b/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c
index c8a99a8c707..8fa12e3da36 100644
--- a/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c
+++ b/gcc/testsuite/gcc.dg/gomp/declare-simd-1.c
@@ -1,5 +1,6 @@ 
 /* Test parsing of #pragma omp declare simd */
 /* { dg-do compile } */
+/* { dg-additional-options "-Wno-old-style-definition" } */
 
 #ifdef __aarch64__
 #pragma omp declare simd uniform (a) aligned (b : 2 * sizeof (int)) \
diff --git a/gcc/testsuite/gcc.dg/ifelse-1.c b/gcc/testsuite/gcc.dg/ifelse-1.c
index 2dd2208b01f..cf111e25ef2 100644
--- a/gcc/testsuite/gcc.dg/ifelse-1.c
+++ b/gcc/testsuite/gcc.dg/ifelse-1.c
@@ -1,6 +1,6 @@ 
 /*
 { dg-do compile }
-{ dg-options "-W -Wall" }
+{ dg-options "-Wno-old-style-definition -W -Wall" }
 */
 
 
diff --git a/gcc/testsuite/gcc.dg/inline-33.c b/gcc/testsuite/gcc.dg/inline-33.c
index 6ce3a5326b8..a8a409d0b77 100644
--- a/gcc/testsuite/gcc.dg/inline-33.c
+++ b/gcc/testsuite/gcc.dg/inline-33.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-optimized"  } */
+/* { dg-options "-std=gnu17 -O3 -fdump-tree-optimized"  } */
 /* { dg-add-options bind_pic_locally } */
 
 int i;
diff --git a/gcc/testsuite/gcc.dg/ipa/inline-5.c b/gcc/testsuite/gcc.dg/ipa/inline-5.c
index 390ba499d67..cef871cc713 100644
--- a/gcc/testsuite/gcc.dg/ipa/inline-5.c
+++ b/gcc/testsuite/gcc.dg/ipa/inline-5.c
@@ -1,6 +1,6 @@ 
 /* Check statements that are eliminated by inlining.  */
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-ipa-fnsummary-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp"  } */
+/* { dg-options "-std=gnu17 -O2 -fdump-ipa-fnsummary-details -fno-early-inlining -fno-partial-inlining -fno-ipa-cp"  } */
 
 struct a {int a,b,c,d,e;};
 void t(int);
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-21.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-21.c
index 67806b866fe..17c1398a11a 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-21.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-21.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 typedef int a;
 typedef int b;
diff --git a/gcc/testsuite/gcc.dg/ipa/pr102714.c b/gcc/testsuite/gcc.dg/ipa/pr102714.c
index 8ab77a61d75..c93496d0ef5 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr102714.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr102714.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-strict-aliasing -fdump-ipa-sra-details -fdump-tree-optimized" } */
+/* { dg-options "-std=gnu17 -O2 -fno-strict-aliasing -fdump-ipa-sra-details -fdump-tree-optimized" } */
 
 typedef _Bool bool;
 
diff --git a/gcc/testsuite/gcc.dg/ipa/pr104813.c b/gcc/testsuite/gcc.dg/ipa/pr104813.c
index 34f413e3823..13e1e06c597 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr104813.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr104813.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O3"  } */
+/* { dg-options "-std=gnu17 -O3"  } */
 
 int a, b, c, d, *e;
 void f(int h) {
diff --git a/gcc/testsuite/gcc.dg/ipa/pr108679.c b/gcc/testsuite/gcc.dg/ipa/pr108679.c
index b1ed50bb831..714cdab653a 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr108679.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr108679.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 struct S1 {
   signed f0;
diff --git a/gcc/testsuite/gcc.dg/ipa/pr42706.c b/gcc/testsuite/gcc.dg/ipa/pr42706.c
index 9c5f43af36f..0cb7d512cfb 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr42706.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr42706.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-early-inlining -fipa-sra"  } */
+/* { dg-options "-std=gnu17 -O2 -fno-early-inlining -fipa-sra"  } */
 
 struct S
 {
diff --git a/gcc/testsuite/gcc.dg/ipa/pr88214.c b/gcc/testsuite/gcc.dg/ipa/pr88214.c
index 4daa9829e75..c621796c140 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr88214.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr88214.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-Wno-old-style-definition -O2" } */
 
 void i();
   short a;
diff --git a/gcc/testsuite/gcc.dg/ipa/pr91853.c b/gcc/testsuite/gcc.dg/ipa/pr91853.c
index 4bad7803751..446096894f4 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr91853.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr91853.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "--param ipa-cp-value-list-size=0 -Os -fno-inline" } */
+/* { dg-options "-Wno-old-style-definition --param ipa-cp-value-list-size=0 -Os -fno-inline" } */
 
 struct _wincore
 {
diff --git a/gcc/testsuite/gcc.dg/ipa/pr93763.c b/gcc/testsuite/gcc.dg/ipa/pr93763.c
index aa2e60c5fc7..6aa4c6ea45e 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr93763.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr93763.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O3" } */
+/* { dg-options "-std=gnu17 -O3" } */
 
 typedef struct a a;
 struct a {
diff --git a/gcc/testsuite/gcc.dg/ipa/pr96482-2.c b/gcc/testsuite/gcc.dg/ipa/pr96482-2.c
index 54b71ac4fc0..77c34e52726 100644
--- a/gcc/testsuite/gcc.dg/ipa/pr96482-2.c
+++ b/gcc/testsuite/gcc.dg/ipa/pr96482-2.c
@@ -1,6 +1,6 @@ 
 /* PR ipa/96482 */
 /* { dg-do compile } */
-/* { dg-options "-O2"  } */
+/* { dg-options "-std=gnu17 -O2"  } */
 
 int i2c_transfer();
 void _dev_err();
diff --git a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
index 89caea868e6..283aedb1347 100644
--- a/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
+++ b/gcc/testsuite/gcc.dg/lto/20091013-1_2.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-Wno-stringop-overread" } */
+/* { dg-options "-std=gnu17 -Wno-stringop-overread" } */
 
 typedef struct HDC__ { int unused; } *HDC;
 typedef struct HFONT__ { int unused; } *HFONT;
diff --git a/gcc/testsuite/gcc.dg/lto/20091015-1_2.c b/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
index 0bc940bc1b1..6fb7002fce9 100644
--- a/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
+++ b/gcc/testsuite/gcc.dg/lto/20091015-1_2.c
@@ -1,3 +1,4 @@ 
+/* { dg-options "-std=gnu17" } */
 #include "20091015-1_a.h"
 #include "20091015-1_b.h"
 void foo ();
diff --git a/gcc/testsuite/gcc.dg/lto/pr113197_1.c b/gcc/testsuite/gcc.dg/lto/pr113197_1.c
index 30bf6f7e7c5..000f8422ec4 100644
--- a/gcc/testsuite/gcc.dg/lto/pr113197_1.c
+++ b/gcc/testsuite/gcc.dg/lto/pr113197_1.c
@@ -1,3 +1,4 @@ 
+/* { dg-options "-std=gnu17" } */
 int a;
 void exit_error();
 void register_dccp() { exit_error(a); }
diff --git a/gcc/testsuite/gcc.dg/lto/pr54702_1.c b/gcc/testsuite/gcc.dg/lto/pr54702_1.c
index c304682e92f..7adc6a37419 100644
--- a/gcc/testsuite/gcc.dg/lto/pr54702_1.c
+++ b/gcc/testsuite/gcc.dg/lto/pr54702_1.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 int *b;
 void *d;
 int c;
diff --git a/gcc/testsuite/gcc.dg/lto/pr99849_0.c b/gcc/testsuite/gcc.dg/lto/pr99849_0.c
index d489cee0f52..5c97a7c75a2 100644
--- a/gcc/testsuite/gcc.dg/lto/pr99849_0.c
+++ b/gcc/testsuite/gcc.dg/lto/pr99849_0.c
@@ -3,7 +3,7 @@ 
 /* { dg-require-effective-target fpic } */
 /* { dg-require-effective-target shared } */
 /* { dg-extra-ld-options { -shared } } */
-/* { dg-lto-options { { -flto -flto-partition=1to1 -O2 -Wno-incompatible-pointer-types -Wno-discarded-qualifiers -fPIC } } } */
+/* { dg-lto-options { { -std=gnu17 -flto -flto-partition=1to1 -O2 -Wno-incompatible-pointer-types -Wno-discarded-qualifiers -fPIC } } } */
 
 struct { struct A *a; } *b;
 struct B { int *b; };
diff --git a/gcc/testsuite/gcc.dg/noncompile/920923-1.c b/gcc/testsuite/gcc.dg/noncompile/920923-1.c
index 006a07131f9..b5ae6bd3b30 100644
--- a/gcc/testsuite/gcc.dg/noncompile/920923-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/920923-1.c
@@ -1,3 +1,4 @@ 
+/* { dg-options "-std=gnu17" } */
 /* { dg-message "undeclared identifier is reported only once" "reminder for mmu_base" { target *-*-* } 0 } */
 typedef BYTE unsigned char;	/* { dg-error "expected" } */
 /* { dg-warning "useless type name in empty declaration" ""  { target *-*-* } .-1 } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c b/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c
index 5f879c3f0ae..cf14acdfa13 100644
--- a/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/old-style-parm-1.c
@@ -2,7 +2,7 @@ 
    accepted.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 void
 f(a)
diff --git a/gcc/testsuite/gcc.dg/noncompile/old-style-parm-3.c b/gcc/testsuite/gcc.dg/noncompile/old-style-parm-3.c
index f9d6d0f686a..0ae86b5959c 100644
--- a/gcc/testsuite/gcc.dg/noncompile/old-style-parm-3.c
+++ b/gcc/testsuite/gcc.dg/noncompile/old-style-parm-3.c
@@ -1,5 +1,6 @@ 
 /* PR c/71266 */
 /* { dg-do compile } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 int fn1 (a)
   enum b {  /* { dg-warning "empty declaration" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr30552-2.c b/gcc/testsuite/gcc.dg/noncompile/pr30552-2.c
index d88488397c6..8351f5d8ed8 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr30552-2.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr30552-2.c
@@ -5,7 +5,7 @@ 
  * internal compiler error.  */
 
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 int main()
 {
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c b/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c
index 23cc7e6b253..0e747be1367 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr30552-3.c
@@ -5,7 +5,7 @@ 
  * user error, not internal compiler error. */
 
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 int main()
 {
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr71265.c b/gcc/testsuite/gcc.dg/noncompile/pr71265.c
index 9c62aab1233..498c00b7ccf 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr71265.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr71265.c
@@ -1,5 +1,6 @@ 
 /* PR c/71265 */
 /* { dg-do compile } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 void ID (ID)
   int ID [__func__]; /* { dg-error "size of array .ID. has non-integer type" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr79758-2.c b/gcc/testsuite/gcc.dg/noncompile/pr79758-2.c
index e6a27f952ef..a9980fb0c4e 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr79758-2.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr79758-2.c
@@ -1,5 +1,6 @@ 
 /* PR c/79758 */
 /* { dg-do compile } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 void fn1 (int[a]) { }; /* { dg-error "undeclared here" } */
 void fn1 (b) { }; /* { dg-error "redefinition" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/pr79758.c b/gcc/testsuite/gcc.dg/noncompile/pr79758.c
index e42a44380fa..eab49250d42 100644
--- a/gcc/testsuite/gcc.dg/noncompile/pr79758.c
+++ b/gcc/testsuite/gcc.dg/noncompile/pr79758.c
@@ -1,6 +1,6 @@ 
 /* PR c/79758 */
 /* { dg-do compile } */
-/* { dg-additional-options "-fpermissive" } */
+/* { dg-additional-options "-Wno-old-style-definition -fpermissive" } */
 
 void fn1 (int[a]) { }; /* { dg-error "undeclared here" } */
 void fn1 (b) { }; /* { dg-error "redefinition" } */
diff --git a/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c b/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
index f36a492e53d..e9ece7578fb 100644
--- a/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
+++ b/gcc/testsuite/gcc.dg/noncompile/va-arg-1.c
@@ -1,3 +1,5 @@ 
+/* { dg-options "-std=gnu17" } */
+
 #include <stdarg.h>
 
 void
diff --git a/gcc/testsuite/gcc.dg/old-style-prom-1.c b/gcc/testsuite/gcc.dg/old-style-prom-1.c
index 165ff982708..f9b41397f84 100644
--- a/gcc/testsuite/gcc.dg/old-style-prom-1.c
+++ b/gcc/testsuite/gcc.dg/old-style-prom-1.c
@@ -1,7 +1,7 @@ 
 /* Test for prototype followed by old-style definition, as in
    dremf-type-compat-1.c but with a non-built-in function.  */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 float f (float, float);
 
diff --git a/gcc/testsuite/gcc.dg/old-style-prom-2.c b/gcc/testsuite/gcc.dg/old-style-prom-2.c
index e7e690e1417..4a1283b668d 100644
--- a/gcc/testsuite/gcc.dg/old-style-prom-2.c
+++ b/gcc/testsuite/gcc.dg/old-style-prom-2.c
@@ -1,7 +1,7 @@ 
 /* Test for prototype followed by old-style definition, as in
    dremf-type-compat-2.c but with a non-built-in function.  */
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
 float f (float, float); /* { dg-warning "prototype declaration" } */
 
diff --git a/gcc/testsuite/gcc.dg/old-style-prom-3.c b/gcc/testsuite/gcc.dg/old-style-prom-3.c
index 720367f2e33..e84b39b90f2 100644
--- a/gcc/testsuite/gcc.dg/old-style-prom-3.c
+++ b/gcc/testsuite/gcc.dg/old-style-prom-3.c
@@ -1,7 +1,7 @@ 
 /* Test for prototype followed by old-style definition, as in
    dremf-type-compat-3.c but with a non-built-in function.  */
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 float f (float, float); /* { dg-error "prototype declaration" } */
 
diff --git a/gcc/testsuite/gcc.dg/old-style-then-proto-1.c b/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
index e3e61861673..d09e76ec6ee 100644
--- a/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
+++ b/gcc/testsuite/gcc.dg/old-style-then-proto-1.c
@@ -2,7 +2,7 @@ 
    Mismatched qualifiers used to be wrongly forbidden.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void f1() {}
 void f1(void); /* { dg-warning "prototype for 'f1' follows non-prototype definition" } */
diff --git a/gcc/testsuite/gcc.dg/parm-incomplete-1.c b/gcc/testsuite/gcc.dg/parm-incomplete-1.c
index 02d97b933f4..0c0ae85d86f 100644
--- a/gcc/testsuite/gcc.dg/parm-incomplete-1.c
+++ b/gcc/testsuite/gcc.dg/parm-incomplete-1.c
@@ -6,7 +6,7 @@ 
    C99 6.7.5.3); the precise rules are unclear.  */
 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 struct s;
 void f (struct s);
diff --git a/gcc/testsuite/gcc.dg/parm-mismatch-1.c b/gcc/testsuite/gcc.dg/parm-mismatch-1.c
index d7621bcd6b2..2136f723ad5 100644
--- a/gcc/testsuite/gcc.dg/parm-mismatch-1.c
+++ b/gcc/testsuite/gcc.dg/parm-mismatch-1.c
@@ -2,7 +2,7 @@ 
    ().  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void f0(); /* { dg-message "note: previous declaration of 'f0'" "note" } */
 void f0(int, ...); /* { dg-error "conflicting types for 'f0'" } */
diff --git a/gcc/testsuite/gcc.dg/permerror-default.c b/gcc/testsuite/gcc.dg/permerror-default.c
index c674d689081..b321a7d6a20 100644
--- a/gcc/testsuite/gcc.dg/permerror-default.c
+++ b/gcc/testsuite/gcc.dg/permerror-default.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 /* Overview test for C permerrors.  This test should be kept in sync with the
    other permerror-* tests.  If new permerrors are added, test cases should be
diff --git a/gcc/testsuite/gcc.dg/permerror-fpermissive-nowarning.c b/gcc/testsuite/gcc.dg/permerror-fpermissive-nowarning.c
index d07c8636677..19629fc952f 100644
--- a/gcc/testsuite/gcc.dg/permerror-fpermissive-nowarning.c
+++ b/gcc/testsuite/gcc.dg/permerror-fpermissive-nowarning.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-fpermissive -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-return-mismatch -Wno-declaration-missing-parameter-type" } */
+/* { dg-options "-std=gnu17 -fpermissive -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-return-mismatch -Wno-declaration-missing-parameter-type" } */
 
 /* This test checks that permerrors can be disabled using -Wno-* options even
    if -fpermissive is used.  */
diff --git a/gcc/testsuite/gcc.dg/permerror-fpermissive.c b/gcc/testsuite/gcc.dg/permerror-fpermissive.c
index fd3020d75ee..46a82001620 100644
--- a/gcc/testsuite/gcc.dg/permerror-fpermissive.c
+++ b/gcc/testsuite/gcc.dg/permerror-fpermissive.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 
 /* Overview test for C permerrors.  This test should be kept in sync with the
    other permerror-* tests.  If new permerrors are added, test cases should be
diff --git a/gcc/testsuite/gcc.dg/permerror-noerror.c b/gcc/testsuite/gcc.dg/permerror-noerror.c
index fc68dfa8bb9..614fb06d6e0 100644
--- a/gcc/testsuite/gcc.dg/permerror-noerror.c
+++ b/gcc/testsuite/gcc.dg/permerror-noerror.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=int-conversion -Wno-error=incompatible-pointer-types -Wno-error=return-mismatch -Wno-error=declaration-missing-parameter-type" } */
+/* { dg-options "-std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=int-conversion -Wno-error=incompatible-pointer-types -Wno-error=return-mismatch -Wno-error=declaration-missing-parameter-type" } */
 
 /* This test should emulate the effect of -fpermissive by adding all the
    -Wno-error= options that are implied by -fpermissive.  It needs to be
diff --git a/gcc/testsuite/gcc.dg/permerror-nowarning.c b/gcc/testsuite/gcc.dg/permerror-nowarning.c
index b1cf7990127..3182a2474b0 100644
--- a/gcc/testsuite/gcc.dg/permerror-nowarning.c
+++ b/gcc/testsuite/gcc.dg/permerror-nowarning.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-return-mismatch -Wno-declaration-missing-parameter-type" } */
+/* { dg-options "-std=gnu17 -Wno-implicit-function-declaration -Wno-implicit-int -Wno-int-conversion -Wno-incompatible-pointer-types -Wno-return-mismatch -Wno-declaration-missing-parameter-type" } */
 
 /* This test checks that permerrors can be disabled using -Wno-* options.  */
 
diff --git a/gcc/testsuite/gcc.dg/permerror-pedantic.c b/gcc/testsuite/gcc.dg/permerror-pedantic.c
index 2380bb2583c..11fa83a8f78 100644
--- a/gcc/testsuite/gcc.dg/permerror-pedantic.c
+++ b/gcc/testsuite/gcc.dg/permerror-pedantic.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 
 /* Overview test for C permerrors.  This test should be kept in sync with the
    other permerror-* tests.  If new permerrors are added, test cases should be
diff --git a/gcc/testsuite/gcc.dg/plugin/infoleak-net-ethtool-ioctl.c b/gcc/testsuite/gcc.dg/plugin/infoleak-net-ethtool-ioctl.c
index dce6e44ae13..52846c40f86 100644
--- a/gcc/testsuite/gcc.dg/plugin/infoleak-net-ethtool-ioctl.c
+++ b/gcc/testsuite/gcc.dg/plugin/infoleak-net-ethtool-ioctl.c
@@ -2,7 +2,7 @@ 
    net/ethtool/ioctl.c  */
 
 /* { dg-do compile } */
-/* { dg-options "-fanalyzer" } */
+/* { dg-options "-std=gnu17 -fanalyzer" } */
 /* { dg-require-effective-target analyzer } */
 
 typedef signed char __s8;
diff --git a/gcc/testsuite/gcc.dg/pointer-array-quals-1.c b/gcc/testsuite/gcc.dg/pointer-array-quals-1.c
index be80912723a..36398ef96f0 100644
--- a/gcc/testsuite/gcc.dg/pointer-array-quals-1.c
+++ b/gcc/testsuite/gcc.dg/pointer-array-quals-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* Origin: Martin Uecker <uecker@eecs.berkeley.edu> */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 void tvoid(void* x);
 void transpose0(double* out, const double* in) { }
 void transpose1(double out[2][2], const double in[2][2]) { }
diff --git a/gcc/testsuite/gcc.dg/pointer-array-quals-2.c b/gcc/testsuite/gcc.dg/pointer-array-quals-2.c
index 4c95d8a3a78..32adf79bb7d 100644
--- a/gcc/testsuite/gcc.dg/pointer-array-quals-2.c
+++ b/gcc/testsuite/gcc.dg/pointer-array-quals-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-pedantic-errors" } */
+/* { dg-options "-std=gnu17 -pedantic-errors" } */
 /* Origin: Martin Uecker <uecker@eecs.berkeley.edu> */
 void tvoid(void* x);
 void transpose0(double* out, const double* in) { }
diff --git a/gcc/testsuite/gcc.dg/pr100791.c b/gcc/testsuite/gcc.dg/pr100791.c
index 00cc4b185a3..f0e7da508de 100644
--- a/gcc/testsuite/gcc.dg/pr100791.c
+++ b/gcc/testsuite/gcc.dg/pr100791.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-fpermissive" } */
+/* { dg-options "-std=gnu17 -fpermissive" } */
 
 static inline int __attribute__((__always_inline__))
 foo ()
diff --git a/gcc/testsuite/gcc.dg/pr100843.c b/gcc/testsuite/gcc.dg/pr100843.c
index 695a2ec3f68..a8ecb5a0c85 100644
--- a/gcc/testsuite/gcc.dg/pr100843.c
+++ b/gcc/testsuite/gcc.dg/pr100843.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -w" } */
+/* { dg-options "-std=gnu17 -O1 -w" } */
 
 char c;
 void *memset();
diff --git a/gcc/testsuite/gcc.dg/pr102273.c b/gcc/testsuite/gcc.dg/pr102273.c
index 568e44ebfef..2cb396edc81 100644
--- a/gcc/testsuite/gcc.dg/pr102273.c
+++ b/gcc/testsuite/gcc.dg/pr102273.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-options "-std=gnu17 -ftrivial-auto-var-init=zero" } */
 
 void bar();
 
diff --git a/gcc/testsuite/gcc.dg/pr102385.c b/gcc/testsuite/gcc.dg/pr102385.c
index bdccc9e43b1..f64017ef90c 100644
--- a/gcc/testsuite/gcc.dg/pr102385.c
+++ b/gcc/testsuite/gcc.dg/pr102385.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-Wall -Wextra -O2 -fno-toplevel-reorder -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-loop-ivcanon -fpredictive-commoning -fdump-tree-pcom-details-blocks -fdump-tree-lim-details-blocks" } */
+/* { dg-options "-std=gnu17 -Wall -Wextra -O2 -fno-toplevel-reorder -fno-tree-ch -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-loop-ivcanon -fpredictive-commoning -fdump-tree-pcom-details-blocks -fdump-tree-lim-details-blocks" } */
 
 short a, b;
 int c[9];
diff --git a/gcc/testsuite/gcc.dg/pr103222.c b/gcc/testsuite/gcc.dg/pr103222.c
index 2a84437b25d..9b629f2fc91 100644
--- a/gcc/testsuite/gcc.dg/pr103222.c
+++ b/gcc/testsuite/gcc.dg/pr103222.c
@@ -1,5 +1,5 @@ 
 // { dg-do run }
-// { dg-options "-O2" }
+// { dg-options "-std=gnu17 -O2" }
 
 #include <stdint.h>
 #include <stdio.h>
diff --git a/gcc/testsuite/gcc.dg/pr105140.c b/gcc/testsuite/gcc.dg/pr105140.c
index 173dc8c2fac..32267f04f38 100644
--- a/gcc/testsuite/gcc.dg/pr105140.c
+++ b/gcc/testsuite/gcc.dg/pr105140.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -Os -w -Wno-psabi" } */
+/* { dg-options "-std=gnu17 -fpermissive -Os -w -Wno-psabi" } */
 /* { dg-skip-if "PR105147" { powerpc*-*-* s390*-*-* } } */
 
 typedef char __attribute__((__vector_size__ (16 * sizeof (char)))) U;
diff --git a/gcc/testsuite/gcc.dg/pr105150.c b/gcc/testsuite/gcc.dg/pr105150.c
index 900460c1555..b8c35c08308 100644
--- a/gcc/testsuite/gcc.dg/pr105150.c
+++ b/gcc/testsuite/gcc.dg/pr105150.c
@@ -1,5 +1,5 @@ 
 /* PR tree-optimization/105150 */
-/* { dg-options "-w -Ofast" } */
+/* { dg-options "-std=gnu17 -w -Ofast" } */
 
 #define A(name) __typeof (__builtin_##name (0)) name (); \
   float name##1 () { return !name (1); } \
diff --git a/gcc/testsuite/gcc.dg/pr105250.c b/gcc/testsuite/gcc.dg/pr105250.c
index c4f4ea0c3d7..ba3b0dd930f 100644
--- a/gcc/testsuite/gcc.dg/pr105250.c
+++ b/gcc/testsuite/gcc.dg/pr105250.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -w -Wno-psabi -O2" } */
+/* { dg-options "-std=gnu17 -fpermissive -w -Wno-psabi -O2" } */
 /* { dg-skip-if "PR105266" { powerpc*-*-* s390*-*-* } } */
 
 typedef int __attribute__((__vector_size__(4))) T;
diff --git a/gcc/testsuite/gcc.dg/pr105972.c b/gcc/testsuite/gcc.dg/pr105972.c
index 73f3385f7eb..93518f60f7f 100644
--- a/gcc/testsuite/gcc.dg/pr105972.c
+++ b/gcc/testsuite/gcc.dg/pr105972.c
@@ -1,6 +1,6 @@ 
 /* PR c/105972 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -g" } */
+/* { dg-options "-Wno-old-style-definition -O2 -g" } */
 
 __attribute__((optimize (0))) int
 foo (void)
diff --git a/gcc/testsuite/gcc.dg/pr111039.c b/gcc/testsuite/gcc.dg/pr111039.c
index a64c46c7edc..0ba142b0a59 100644
--- a/gcc/testsuite/gcc.dg/pr111039.c
+++ b/gcc/testsuite/gcc.dg/pr111039.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O" } */
+/* { dg-options "-std=gnu17 -O" } */
 
 #if __SIZEOF_INT__ < 4
 #define int __INT32_TYPE__
diff --git a/gcc/testsuite/gcc.dg/pr111407.c b/gcc/testsuite/gcc.dg/pr111407.c
index a171074753f..211e19f899f 100644
--- a/gcc/testsuite/gcc.dg/pr111407.c
+++ b/gcc/testsuite/gcc.dg/pr111407.c
@@ -1,6 +1,6 @@ 
 /* PR tree-optimization/111407*/
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 enum { SEND_TOFILE } __sigsetjmp();
 void fclose();
 void foldergets();
diff --git a/gcc/testsuite/gcc.dg/pr111922.c b/gcc/testsuite/gcc.dg/pr111922.c
index 4f429d741c7..7201c0ef215 100644
--- a/gcc/testsuite/gcc.dg/pr111922.c
+++ b/gcc/testsuite/gcc.dg/pr111922.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fno-tree-fre" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fno-tree-fre" } */
 
 void f2 (void);
 void f4 (int, int, int);
diff --git a/gcc/testsuite/gcc.dg/pr15236.c b/gcc/testsuite/gcc.dg/pr15236.c
index b01a4e85873..9b92489738d 100644
--- a/gcc/testsuite/gcc.dg/pr15236.c
+++ b/gcc/testsuite/gcc.dg/pr15236.c
@@ -1,7 +1,7 @@ 
 /* PR 15236: pedantic switch modifies treatment of non-ISO compliant
    enumerations.  */
 /* { dg-do compile } */
-/* { dg-options "-Wall -Wextra -pedantic-errors -Wconversion" } */
+/* { dg-options "-std=gnu17 -Wall -Wextra -pedantic-errors -Wconversion" } */
 typedef enum OMX_ERRORTYPE
 {
   OMX_ErrorNone = 0,
diff --git a/gcc/testsuite/gcc.dg/pr17188-1.c b/gcc/testsuite/gcc.dg/pr17188-1.c
index 522a14f7d75..142f42acdac 100644
--- a/gcc/testsuite/gcc.dg/pr17188-1.c
+++ b/gcc/testsuite/gcc.dg/pr17188-1.c
@@ -3,7 +3,7 @@ 
    diagnosed.  Bug 17188.  */
 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 struct s0 { }; /* { dg-message "note: originally defined here" } */
 struct s0;
diff --git a/gcc/testsuite/gcc.dg/pr20368-1.c b/gcc/testsuite/gcc.dg/pr20368-1.c
index 4140397c142..2959328e6a6 100644
--- a/gcc/testsuite/gcc.dg/pr20368-1.c
+++ b/gcc/testsuite/gcc.dg/pr20368-1.c
@@ -1,7 +1,7 @@ 
 /* ICE with -Wstrict-prototypes and typeof an undeclared function.
    Bug 20368.  */
 /* { dg-do compile } */
-/* { dg-options "-Wstrict-prototypes" } */
+/* { dg-options "-std=gnu17 -Wstrict-prototypes" } */
 
 extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */
 
diff --git a/gcc/testsuite/gcc.dg/pr20368-2.c b/gcc/testsuite/gcc.dg/pr20368-2.c
index 7faded6bd8c..3ca5f6363a3 100644
--- a/gcc/testsuite/gcc.dg/pr20368-2.c
+++ b/gcc/testsuite/gcc.dg/pr20368-2.c
@@ -1,7 +1,7 @@ 
 /* ICE with -Wstrict-prototypes and typeof an undeclared function.
    Bug 20368.  Test with -Wmissing-prototypes.  */
 /* { dg-do compile } */
-/* { dg-options "-Wmissing-prototypes" } */
+/* { dg-options "-std=gnu17 -Wmissing-prototypes" } */
 
 extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */
 
diff --git a/gcc/testsuite/gcc.dg/pr20368-3.c b/gcc/testsuite/gcc.dg/pr20368-3.c
index 0d0ea6dfcc3..e3b5194efa0 100644
--- a/gcc/testsuite/gcc.dg/pr20368-3.c
+++ b/gcc/testsuite/gcc.dg/pr20368-3.c
@@ -1,7 +1,7 @@ 
 /* ICE with -Wstrict-prototypes and typeof an undeclared function.
    Bug 20368.  Test with -Wmissing-declarations.  */
 /* { dg-do compile } */
-/* { dg-options "-Wmissing-declarations" } */
+/* { dg-options "-std=gnu17 -Wmissing-declarations" } */
 
 extern __typeof (f) g; /* { dg-error "'f' undeclared here \\(not in a function\\)" } */
 
diff --git a/gcc/testsuite/gcc.dg/pr27331.c b/gcc/testsuite/gcc.dg/pr27331.c
index 9b5c71e8437..50ec9a1f625 100644
--- a/gcc/testsuite/gcc.dg/pr27331.c
+++ b/gcc/testsuite/gcc.dg/pr27331.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize" } */
+/* { dg-options "-Wno-old-style-definition -O2 -ftree-vectorize" } */
 
 struct funny_match
 {
diff --git a/gcc/testsuite/gcc.dg/pr27861-1.c b/gcc/testsuite/gcc.dg/pr27861-1.c
index 8d6d791bcac..e8f86f289ca 100644
--- a/gcc/testsuite/gcc.dg/pr27861-1.c
+++ b/gcc/testsuite/gcc.dg/pr27861-1.c
@@ -4,7 +4,7 @@ 
    later producing a VAR_DECL tree whose DECL_RTL's mode didn't match
    the VAR_DECL's type's mode.  */
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 typedef struct sim_state *SIM_DESC;
 typedef enum
diff --git a/gcc/testsuite/gcc.dg/pr28121.c b/gcc/testsuite/gcc.dg/pr28121.c
index 9e306f5930a..93d065fc2c3 100644
--- a/gcc/testsuite/gcc.dg/pr28121.c
+++ b/gcc/testsuite/gcc.dg/pr28121.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 int GetMouseButton ();
 int ParsePos ();
diff --git a/gcc/testsuite/gcc.dg/pr28243.c b/gcc/testsuite/gcc.dg/pr28243.c
index a6d693e224c..fd08b9926fd 100644
--- a/gcc/testsuite/gcc.dg/pr28243.c
+++ b/gcc/testsuite/gcc.dg/pr28243.c
@@ -3,7 +3,7 @@ 
 
 /* { dg-do compile } */
 /* { dg-require-effective-target fpic } */
-/* { dg-options "-O2 -ftracer -fPIC" } */
+/* { dg-options "-std=gnu17 -O2 -ftracer -fPIC" } */
 
 struct displayfuncs {
   void (*init) ();
diff --git a/gcc/testsuite/gcc.dg/pr28888.c b/gcc/testsuite/gcc.dg/pr28888.c
index 3bad18b9fdf..dea52f1b269 100644
--- a/gcc/testsuite/gcc.dg/pr28888.c
+++ b/gcc/testsuite/gcc.dg/pr28888.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftree-vectorize" } */
+/* { dg-options "-std=gnu17 -O2 -ftree-vectorize" } */
 
 static const unsigned char _c30[] =
   "statistic of allocated integer registers:";
diff --git a/gcc/testsuite/gcc.dg/pr29254.c b/gcc/testsuite/gcc.dg/pr29254.c
index df6ba574a5d..1770a9710b7 100644
--- a/gcc/testsuite/gcc.dg/pr29254.c
+++ b/gcc/testsuite/gcc.dg/pr29254.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O3 -Werror" } */
+/* { dg-options "-std=gnu17 -O3 -Werror" } */
 
 int value_compare ();
 
diff --git a/gcc/testsuite/gcc.dg/pr34457-1.c b/gcc/testsuite/gcc.dg/pr34457-1.c
index 3dca13df093..ef2419f4535 100644
--- a/gcc/testsuite/gcc.dg/pr34457-1.c
+++ b/gcc/testsuite/gcc.dg/pr34457-1.c
@@ -2,7 +2,7 @@ 
 /* { dg-do link } */
 /* { dg-require-effective-target trampolines } */
 /* { dg-require-effective-target lto } */
-/* { dg-options "-flto -O2" } */
+/* { dg-options "-std=gnu17 -flto -O2" } */
 /* { dg-additional-sources "pr34457-2.c" } */
    
 
diff --git a/gcc/testsuite/gcc.dg/pr36015.c b/gcc/testsuite/gcc.dg/pr36015.c
index fc31535598d..85b441c63c1 100644
--- a/gcc/testsuite/gcc.dg/pr36015.c
+++ b/gcc/testsuite/gcc.dg/pr36015.c
@@ -1,7 +1,7 @@ 
 /* PR target/36015 */
 /* { dg-do run } */
-/* { dg-options "-O0" } */
-/* { dg-options "-O0 -mregparm=3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-std=gnu17 -O0" } */
+/* { dg-options "-std=gnu17 -O0 -mregparm=3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 static int test ();
 
diff --git a/gcc/testsuite/gcc.dg/pr38245-3.c b/gcc/testsuite/gcc.dg/pr38245-3.c
index 6ef8372a14f..ae687c68efa 100644
--- a/gcc/testsuite/gcc.dg/pr38245-3.c
+++ b/gcc/testsuite/gcc.dg/pr38245-3.c
@@ -1,7 +1,7 @@ 
 /* PR rtl-optimization/38245 */
 /* { dg-do run } */
 /* { dg-additional-sources "pr38245-4.c" } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 #include "pr38245-3.h"
 
diff --git a/gcc/testsuite/gcc.dg/pr38245-4.c b/gcc/testsuite/gcc.dg/pr38245-4.c
index c9b3d2d8fb8..7b63b989ffa 100644
--- a/gcc/testsuite/gcc.dg/pr38245-4.c
+++ b/gcc/testsuite/gcc.dg/pr38245-4.c
@@ -1,6 +1,6 @@ 
 /* PR rtl-optimization/38245 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 #include "pr38245-3.h"
 
diff --git a/gcc/testsuite/gcc.dg/pr41241.c b/gcc/testsuite/gcc.dg/pr41241.c
index 42fb2f7e5c7..5364a0a5935 100644
--- a/gcc/testsuite/gcc.dg/pr41241.c
+++ b/gcc/testsuite/gcc.dg/pr41241.c
@@ -1,7 +1,7 @@ 
 /* PR bootstrap/41241 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -fcompare-debug -g" } */
-/* { dg-options "-O2 -fcompare-debug -g -march=i586 -mtune=i586 -fomit-frame-pointer" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-std=gnu17 -O2 -fcompare-debug -g" } */
+/* { dg-options "-std=gnu17 -O2 -fcompare-debug -g -march=i586 -mtune=i586 -fomit-frame-pointer" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 typedef struct { int t1; int t2; int t3; } *T;
 typedef struct { int s; } S;
diff --git a/gcc/testsuite/gcc.dg/pr43058.c b/gcc/testsuite/gcc.dg/pr43058.c
index bba6f814a71..c1ba39c1242 100644
--- a/gcc/testsuite/gcc.dg/pr43058.c
+++ b/gcc/testsuite/gcc.dg/pr43058.c
@@ -1,6 +1,6 @@ 
 /* PR debug/43058 */
 /* { dg-do compile } */
-/* { dg-options "-g -O2" } */
+/* { dg-options "-std=gnu17 -g -O2" } */
 /* { dg-timeout-factor 4 } */
 
 extern void *f1 (void *, void *, void *);
diff --git a/gcc/testsuite/gcc.dg/pr44539.c b/gcc/testsuite/gcc.dg/pr44539.c
index 9cfff7a3ae5..cb9a631dead 100644
--- a/gcc/testsuite/gcc.dg/pr44539.c
+++ b/gcc/testsuite/gcc.dg/pr44539.c
@@ -1,6 +1,6 @@ 
 /* PR tree-optimization/44539 */
 /* { dg-do compile } */
-/* { dg-options "-ftracer -freorder-blocks -O2" } */
+/* { dg-options "-std=gnu17 -ftracer -freorder-blocks -O2" } */
 
 void bar (int file);
 extern int baz (void);
diff --git a/gcc/testsuite/gcc.dg/pr45055.c b/gcc/testsuite/gcc.dg/pr45055.c
index 899de50498b..305f8239150 100644
--- a/gcc/testsuite/gcc.dg/pr45055.c
+++ b/gcc/testsuite/gcc.dg/pr45055.c
@@ -1,6 +1,6 @@ 
 /* PR debug/45055 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -ftracer -fsched-pressure -funroll-loops -fschedule-insns -fcompare-debug" } */
+/* { dg-options "-std=gnu17 -O2 -ftracer -fsched-pressure -funroll-loops -fschedule-insns -fcompare-debug" } */
 /* { dg-require-effective-target scheduling } */
 
 int colormap[10];
diff --git a/gcc/testsuite/gcc.dg/pr50908.c b/gcc/testsuite/gcc.dg/pr50908.c
index 114dded3ab1..3083a527c30 100644
--- a/gcc/testsuite/gcc.dg/pr50908.c
+++ b/gcc/testsuite/gcc.dg/pr50908.c
@@ -1,6 +1,6 @@ 
 /* { dg-do compile } */
 /* { dg-require-effective-target lp64 } */
-/* { dg-options "-O2 -ftree-tail-merge" } */
+/* { dg-options "-Wno-old-style-definition -O2 -ftree-tail-merge" } */
 
 enum Lisp_Type
 {
diff --git a/gcc/testsuite/gcc.dg/pr60647-1.c b/gcc/testsuite/gcc.dg/pr60647-1.c
index 99f5919c34c..e5d77f2e52e 100644
--- a/gcc/testsuite/gcc.dg/pr60647-1.c
+++ b/gcc/testsuite/gcc.dg/pr60647-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-Wno-old-style-definition -O2" } */
 
 struct _wincore
 {
diff --git a/gcc/testsuite/gcc.dg/pr63762.c b/gcc/testsuite/gcc.dg/pr63762.c
index df110676eca..8de8e63bfc0 100644
--- a/gcc/testsuite/gcc.dg/pr63762.c
+++ b/gcc/testsuite/gcc.dg/pr63762.c
@@ -1,6 +1,6 @@ 
 /* PR middle-end/63762 */
 /* { dg-do assemble } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 #include <stdlib.h>
 
diff --git a/gcc/testsuite/gcc.dg/pr63804.c b/gcc/testsuite/gcc.dg/pr63804.c
index f0a02f26ae4..f92822add96 100644
--- a/gcc/testsuite/gcc.dg/pr63804.c
+++ b/gcc/testsuite/gcc.dg/pr63804.c
@@ -1,6 +1,6 @@ 
 /* PR rtl-optimization/63804 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -g" } */
+/* { dg-options "-std=gnu17 -O2 -g" } */
 
 struct A { int gen; } e;
 int a, d;
diff --git a/gcc/testsuite/gcc.dg/pr68306-3.c b/gcc/testsuite/gcc.dg/pr68306-3.c
index f5a8c102cf8..cac464f492e 100644
--- a/gcc/testsuite/gcc.dg/pr68306-3.c
+++ b/gcc/testsuite/gcc.dg/pr68306-3.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O3" } */
+/* { dg-options "-std=gnu17 -O3" } */
 /* { dg-additional-options "-mno-sse -mno-mmx" { target i?86-*-* x86_64-*-* } } */
 /* { dg-additional-options "-mno-altivec -mno-vsx" { target powerpc*-*-* } } */
 
diff --git a/gcc/testsuite/gcc.dg/pr68533.c b/gcc/testsuite/gcc.dg/pr68533.c
index 49e67a96168..5e9a4c6c991 100644
--- a/gcc/testsuite/gcc.dg/pr68533.c
+++ b/gcc/testsuite/gcc.dg/pr68533.c
@@ -1,6 +1,6 @@ 
 /* PR c/68533 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 struct T { int t; };
 
diff --git a/gcc/testsuite/gcc.dg/pr69156.c b/gcc/testsuite/gcc.dg/pr69156.c
index 5740971383c..97b46aaa0e8 100644
--- a/gcc/testsuite/gcc.dg/pr69156.c
+++ b/gcc/testsuite/gcc.dg/pr69156.c
@@ -1,6 +1,6 @@ 
 /* PR tree-optimization/69156 */
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -O1 -fno-tree-ccp" } */
+/* { dg-options "-std=gnu17 -fpermissive -O1 -fno-tree-ccp" } */
 
 _Bool
 foo ()
diff --git a/gcc/testsuite/gcc.dg/pr7356-2.c b/gcc/testsuite/gcc.dg/pr7356-2.c
index ad679756978..9bed60d435d 100644
--- a/gcc/testsuite/gcc.dg/pr7356-2.c
+++ b/gcc/testsuite/gcc.dg/pr7356-2.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-fdiagnostics-show-caret" } */
+/* { dg-options "-Wno-old-style-definition -fdiagnostics-show-caret" } */
 
 int i /* { dg-error "6: expected ';' before 'int'" } */
 int j;
diff --git a/gcc/testsuite/gcc.dg/pr79983.c b/gcc/testsuite/gcc.dg/pr79983.c
index 1e292d42108..2cf83004b7c 100644
--- a/gcc/testsuite/gcc.dg/pr79983.c
+++ b/gcc/testsuite/gcc.dg/pr79983.c
@@ -1,6 +1,6 @@ 
 /* PR c/79983 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 struct S;
 struct S { int i; }; /* { dg-message "originally defined here" } */
diff --git a/gcc/testsuite/gcc.dg/pr83463.c b/gcc/testsuite/gcc.dg/pr83463.c
index 9142d273e7c..2af130cf3b0 100644
--- a/gcc/testsuite/gcc.dg/pr83463.c
+++ b/gcc/testsuite/gcc.dg/pr83463.c
@@ -1,7 +1,7 @@ 
 /* PR middle-end/83463 */
 /* { dg-do compile } */
 /* { dg-prune-output "conflicting types for built-in" } */
-/* { dg-options "-O2 -Wrestrict -Wno-pointer-to-int-cast" } */
+/* { dg-options "-std=gnu17 -O2 -Wrestrict -Wno-pointer-to-int-cast" } */
 
 int *a;
 void *memcpy ();
diff --git a/gcc/testsuite/gcc.dg/pr87347.c b/gcc/testsuite/gcc.dg/pr87347.c
index 2077964e9d3..009f95904fc 100644
--- a/gcc/testsuite/gcc.dg/pr87347.c
+++ b/gcc/testsuite/gcc.dg/pr87347.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-Wabsolute-value" } */
+/* { dg-options "-std=gnu17 -Wabsolute-value" } */
 
 int a;
 int abs();
diff --git a/gcc/testsuite/gcc.dg/pr89521-1.c b/gcc/testsuite/gcc.dg/pr89521-1.c
index ebf2c5932c3..282c4f8b5ee 100644
--- a/gcc/testsuite/gcc.dg/pr89521-1.c
+++ b/gcc/testsuite/gcc.dg/pr89521-1.c
@@ -1,6 +1,6 @@ 
 /* PR c/89521 */
 /* { dg-do compile } */
-/* { dg-options "-Ofast -w" } */
+/* { dg-options "-std=gnu17 -Ofast -w" } */
 
 #define A(name) __typeof (__builtin_##name (0)) name (); long name##1 () { return name (1); }
 #define B(name) A(name) A(name##f) A(name##l)
diff --git a/gcc/testsuite/gcc.dg/pr89521-2.c b/gcc/testsuite/gcc.dg/pr89521-2.c
index 5e37c918fc2..b5ef8860e55 100644
--- a/gcc/testsuite/gcc.dg/pr89521-2.c
+++ b/gcc/testsuite/gcc.dg/pr89521-2.c
@@ -1,6 +1,6 @@ 
 /* PR c/89521 */
 /* { dg-do compile } */
-/* { dg-options "-Ofast -w" } */
+/* { dg-options "-std=gnu17 -Ofast -w" } */
 
 #define A(name) __typeof (__builtin_##name (0)) name (); \
   float name##1 () { return name (1); } \
diff --git a/gcc/testsuite/gcc.dg/pr90648.c b/gcc/testsuite/gcc.dg/pr90648.c
index bf1fa989478..5a9922d5f87 100644
--- a/gcc/testsuite/gcc.dg/pr90648.c
+++ b/gcc/testsuite/gcc.dg/pr90648.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O" } */
+/* { dg-options "-std=gnu17 -O" } */
 
 extern double copysign ();
 double foo (double x)
diff --git a/gcc/testsuite/gcc.dg/pr93573-1.c b/gcc/testsuite/gcc.dg/pr93573-1.c
index 26ec9b77d6f..50a1c9747a9 100644
--- a/gcc/testsuite/gcc.dg/pr93573-1.c
+++ b/gcc/testsuite/gcc.dg/pr93573-1.c
@@ -1,6 +1,6 @@ 
 /* PR c/93573 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void bar ();
 
diff --git a/gcc/testsuite/gcc.dg/pr94167.c b/gcc/testsuite/gcc.dg/pr94167.c
index 4b819d3a869..efc87ab03fa 100644
--- a/gcc/testsuite/gcc.dg/pr94167.c
+++ b/gcc/testsuite/gcc.dg/pr94167.c
@@ -1,6 +1,6 @@ 
 /* PR debug/94167 */
 /* { dg-do compile } */
-/* { dg-options "-O2 -fcompare-debug" } */
+/* { dg-options "-std=gnu17 -O2 -fcompare-debug" } */
 
 struct S { int g, h; signed char i; int j; signed char k; int l[4]; } a, c;
 struct T { signed char g; } e;
diff --git a/gcc/testsuite/gcc.dg/pr94705.c b/gcc/testsuite/gcc.dg/pr94705.c
index 96392ab60ee..6bd92f171e4 100644
--- a/gcc/testsuite/gcc.dg/pr94705.c
+++ b/gcc/testsuite/gcc.dg/pr94705.c
@@ -1,6 +1,6 @@ 
 /* PR c/94705 */
 /* { dg-do compile } */
-/* { dg-options "" } */
+/* { dg-options "-std=gnu17" } */
 
 void foo ();
 
diff --git a/gcc/testsuite/gcc.dg/pr95118.c b/gcc/testsuite/gcc.dg/pr95118.c
index 69bc47fd7aa..59173e6c577 100644
--- a/gcc/testsuite/gcc.dg/pr95118.c
+++ b/gcc/testsuite/gcc.dg/pr95118.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-fre" } */
+/* { dg-options "-std=gnu17 -O2 -fdump-tree-fre" } */
 
 void a();
 void b() {
diff --git a/gcc/testsuite/gcc.dg/pr96335.c b/gcc/testsuite/gcc.dg/pr96335.c
index ab243b3d129..a6203f38a03 100644
--- a/gcc/testsuite/gcc.dg/pr96335.c
+++ b/gcc/testsuite/gcc.dg/pr96335.c
@@ -1,6 +1,6 @@ 
 /* PR middle-end/96335 */
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 void bar (int, void *) __attribute__((__access__(__read_only__, 2)));
 
diff --git a/gcc/testsuite/gcc.dg/pr97830.c b/gcc/testsuite/gcc.dg/pr97830.c
index 3729a65aec2..fd79620e770 100644
--- a/gcc/testsuite/gcc.dg/pr97830.c
+++ b/gcc/testsuite/gcc.dg/pr97830.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 typedef enum { LangC } cLanguage;
 typedef enum { FunctionOneArg, FunctionStandard } cFunctionType;
diff --git a/gcc/testsuite/gcc.dg/pr97882.c b/gcc/testsuite/gcc.dg/pr97882.c
index 48ea93d53c7..6666f898562 100644
--- a/gcc/testsuite/gcc.dg/pr97882.c
+++ b/gcc/testsuite/gcc.dg/pr97882.c
@@ -1,6 +1,6 @@ 
 /* PR c/97882 - Segmentation Fault on improper redeclaration of function
    { dg-do compile }
-   { dg-options "" } */
+   { dg-options "-std=gnu17" } */
 
 // Check pointer declaration incompatibiliies.
 
diff --git a/gcc/testsuite/gcc.dg/pr99122-2.c b/gcc/testsuite/gcc.dg/pr99122-2.c
index c0c850f141c..3947f7dcdc8 100644
--- a/gcc/testsuite/gcc.dg/pr99122-2.c
+++ b/gcc/testsuite/gcc.dg/pr99122-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -g -w" } */
+/* { dg-options "-std=gnu17 -O2 -g -w" } */
 /* { dg-require-effective-target alloca } */
 
 static int foo ();
diff --git a/gcc/testsuite/gcc.dg/pr99122-3.c b/gcc/testsuite/gcc.dg/pr99122-3.c
index 6a908ad86c0..3e72a303277 100644
--- a/gcc/testsuite/gcc.dg/pr99122-3.c
+++ b/gcc/testsuite/gcc.dg/pr99122-3.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -g -w" } */
+/* { dg-options "-std=gnu17 -O2 -g -w" } */
 
 static int foo ();
 
diff --git a/gcc/testsuite/gcc.dg/qual-component-1.c b/gcc/testsuite/gcc.dg/qual-component-1.c
index 4eaa71a2d19..f2043ce5144 100644
--- a/gcc/testsuite/gcc.dg/qual-component-1.c
+++ b/gcc/testsuite/gcc.dg/qual-component-1.c
@@ -3,7 +3,7 @@ 
    union.  Bug 27697 from Frank Victor Fischer.  */
 /* Origin: Joseph Myers <joseph@codesourcery.com> */
 /* { dg-do compile } */
-/* { dg-options "-pedantic -Wdiscarded-array-qualifiers" } */
+/* { dg-options "-std=gnu17 -pedantic -Wdiscarded-array-qualifiers" } */
 
 struct s {
   int a;
diff --git a/gcc/testsuite/gcc.dg/sibcall-6.c b/gcc/testsuite/gcc.dg/sibcall-6.c
index 8ee72cac444..c8830b665e9 100644
--- a/gcc/testsuite/gcc.dg/sibcall-6.c
+++ b/gcc/testsuite/gcc.dg/sibcall-6.c
@@ -8,7 +8,7 @@ 
 
 /* { dg-do run { target epiphany-*-* i?86-*-* x86_64-*-* s390*-*-* } } */
 /* { dg-skip-if "" { { i?86-*-* x86_64-*-* } && { ia32 && { ! nonpic } } } } */
-/* { dg-options "-O2 -foptimize-sibling-calls -fno-ipa-cp" } */
+/* { dg-options "-Wno-old-style-definition -O2 -foptimize-sibling-calls -fno-ipa-cp" } */
 
 extern void abort (void);
 extern void exit (int);
diff --git a/gcc/testsuite/gcc.dg/sms-2.c b/gcc/testsuite/gcc.dg/sms-2.c
index f8375f9f05d..61723141d96 100644
--- a/gcc/testsuite/gcc.dg/sms-2.c
+++ b/gcc/testsuite/gcc.dg/sms-2.c
@@ -2,7 +2,7 @@ 
    traversal of the loops after versioning.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fmodulo-sched -fdump-rtl-sms" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fmodulo-sched -fdump-rtl-sms" } */
 
 int th, h, em, nlwm, nlwS, nlw, sy;
 void
diff --git a/gcc/testsuite/gcc.dg/tm/20091221.c b/gcc/testsuite/gcc.dg/tm/20091221.c
index 7837243fe5c..655e55cfb24 100644
--- a/gcc/testsuite/gcc.dg/tm/20091221.c
+++ b/gcc/testsuite/gcc.dg/tm/20091221.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-fgnu-tm -fdump-tree-tmedge" } */
+/* { dg-options "-std=gnu17 -fgnu-tm -fdump-tree-tmedge" } */
 
 int i;
 extern void virgin () __attribute__((transaction_pure));
diff --git a/gcc/testsuite/gcc.dg/torture/bfloat16-basic.c b/gcc/testsuite/gcc.dg/torture/bfloat16-basic.c
index 09e54d4470a..20ce60eb7af 100644
--- a/gcc/testsuite/gcc.dg/torture/bfloat16-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/bfloat16-basic.c
@@ -1,6 +1,6 @@ 
 /* Test __bf16.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options bfloat16 } */
 /* { dg-require-effective-target bfloat16_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float128-basic.c b/gcc/testsuite/gcc.dg/torture/float128-basic.c
index b23d45bf72b..24a22b0eb15 100644
--- a/gcc/testsuite/gcc.dg/torture/float128-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float128-basic.c
@@ -1,6 +1,6 @@ 
 /* Test _Float128.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float128 } */
 /* { dg-require-effective-target float128_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float128x-basic.c b/gcc/testsuite/gcc.dg/torture/float128x-basic.c
index 75c5a28bb9d..ea80990a617 100644
--- a/gcc/testsuite/gcc.dg/torture/float128x-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float128x-basic.c
@@ -1,6 +1,6 @@ 
 /* Test _Float128x.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float128x } */
 /* { dg-require-effective-target float128x_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float16-basic.c b/gcc/testsuite/gcc.dg/torture/float16-basic.c
index e94aa203d40..adcbdf936b5 100644
--- a/gcc/testsuite/gcc.dg/torture/float16-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float16-basic.c
@@ -1,6 +1,6 @@ 
 /* Test _Float16.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float16 } */
 /* { dg-require-effective-target float16_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float32-basic.c b/gcc/testsuite/gcc.dg/torture/float32-basic.c
index 2d3e7a96175..e6b2785bdef 100644
--- a/gcc/testsuite/gcc.dg/torture/float32-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float32-basic.c
@@ -1,6 +1,6 @@ 
 /* Test _Float32.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float32 } */
 /* { dg-require-effective-target float32_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float32x-basic.c b/gcc/testsuite/gcc.dg/torture/float32x-basic.c
index f2abc332488..b4ca33f6375 100644
--- a/gcc/testsuite/gcc.dg/torture/float32x-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float32x-basic.c
@@ -1,6 +1,6 @@ 
 /* Test _Float32x.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float32x } */
 /* { dg-require-effective-target float32x_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float64-basic.c b/gcc/testsuite/gcc.dg/torture/float64-basic.c
index decb05f34b2..7e644c31718 100644
--- a/gcc/testsuite/gcc.dg/torture/float64-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float64-basic.c
@@ -1,6 +1,6 @@ 
 /* Test _Float64.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float64 } */
 /* { dg-require-effective-target float64_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/float64x-basic.c b/gcc/testsuite/gcc.dg/torture/float64x-basic.c
index 7a140af0bd7..90dac84bf0b 100644
--- a/gcc/testsuite/gcc.dg/torture/float64x-basic.c
+++ b/gcc/testsuite/gcc.dg/torture/float64x-basic.c
@@ -1,6 +1,6 @@ 
 /* Test _Float64x.  */
 /* { dg-do run } */
-/* { dg-options "" } */
+/* { dg-options "-Wno-old-style-definition" } */
 /* { dg-add-options float64x } */
 /* { dg-require-effective-target float64x_runtime } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr102762.c b/gcc/testsuite/gcc.dg/torture/pr102762.c
index 67c6b00ccea..2e484b62da2 100644
--- a/gcc/testsuite/gcc.dg/torture/pr102762.c
+++ b/gcc/testsuite/gcc.dg/torture/pr102762.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 /* We fail to diagnose the invalid __builtin_va_arg_pack use with -flto.  */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr103987.c b/gcc/testsuite/gcc.dg/torture/pr103987.c
index 6bfc76881a1..21fb77bbc77 100644
--- a/gcc/testsuite/gcc.dg/torture/pr103987.c
+++ b/gcc/testsuite/gcc.dg/torture/pr103987.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 void foo();
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr104825.c b/gcc/testsuite/gcc.dg/torture/pr104825.c
index 7affacc2094..417012e5fdd 100644
--- a/gcc/testsuite/gcc.dg/torture/pr104825.c
+++ b/gcc/testsuite/gcc.dg/torture/pr104825.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-additional-options "-Wno-stringop-overread" } */
+/* { dg-additional-options "-Wno-old-style-definition -Wno-stringop-overread" } */
 
 int foo (fmt)
 char* fmt;
diff --git a/gcc/testsuite/gcc.dg/torture/pr105166.c b/gcc/testsuite/gcc.dg/torture/pr105166.c
index 60e8b73a466..ecad57575bb 100644
--- a/gcc/testsuite/gcc.dg/torture/pr105166.c
+++ b/gcc/testsuite/gcc.dg/torture/pr105166.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 int bar (foo, a)
   int (**foo) ();
diff --git a/gcc/testsuite/gcc.dg/torture/pr105185.c b/gcc/testsuite/gcc.dg/torture/pr105185.c
index 6ab32360de1..03b62c5381c 100644
--- a/gcc/testsuite/gcc.dg/torture/pr105185.c
+++ b/gcc/testsuite/gcc.dg/torture/pr105185.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 int foo (fmt)
 char* fmt;
diff --git a/gcc/testsuite/gcc.dg/torture/pr109652.c b/gcc/testsuite/gcc.dg/torture/pr109652.c
index 8a6524d2212..e829cc132ec 100644
--- a/gcc/testsuite/gcc.dg/torture/pr109652.c
+++ b/gcc/testsuite/gcc.dg/torture/pr109652.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 typedef int UInt;
 UInt skeletal_RI5_instr;
diff --git a/gcc/testsuite/gcc.dg/torture/pr112444.c b/gcc/testsuite/gcc.dg/torture/pr112444.c
index 61c7ec9b22e..769df6ae6ac 100644
--- a/gcc/testsuite/gcc.dg/torture/pr112444.c
+++ b/gcc/testsuite/gcc.dg/torture/pr112444.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-additional-options "-ftrivial-auto-var-init=zero" } */
+/* { dg-additional-options "-std=gnu17 -ftrivial-auto-var-init=zero" } */
 
 int qmi_message_pbm_get_all_capabilities_output_capability_basic_information_get_printable_message_offset,
     qmi_message_pbm_get_all_capabilities_output_capability_basic_information_get_printable_message_init_offset,
diff --git a/gcc/testsuite/gcc.dg/torture/pr113895-3.c b/gcc/testsuite/gcc.dg/torture/pr113895-3.c
index 255975f3353..4759ba5c6ae 100644
--- a/gcc/testsuite/gcc.dg/torture/pr113895-3.c
+++ b/gcc/testsuite/gcc.dg/torture/pr113895-3.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 extern void f();
 char a[1][1], b;
diff --git a/gcc/testsuite/gcc.dg/torture/pr24626-2.c b/gcc/testsuite/gcc.dg/torture/pr24626-2.c
index 541c8c5aca4..4f17de56d65 100644
--- a/gcc/testsuite/gcc.dg/torture/pr24626-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr24626-2.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
 typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
diff --git a/gcc/testsuite/gcc.dg/torture/pr25183.c b/gcc/testsuite/gcc.dg/torture/pr25183.c
index 84b4c8f8d44..22af72b8dd0 100644
--- a/gcc/testsuite/gcc.dg/torture/pr25183.c
+++ b/gcc/testsuite/gcc.dg/torture/pr25183.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-pedantic" } */
+/* { dg-options "-std=gnu17 -pedantic" } */
 
 enum err {
   err_IO = 0x8a450000, /* { dg-warning "int" } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr38948.c b/gcc/testsuite/gcc.dg/torture/pr38948.c
index 22cef3b356d..01b7213e90f 100644
--- a/gcc/testsuite/gcc.dg/torture/pr38948.c
+++ b/gcc/testsuite/gcc.dg/torture/pr38948.c
@@ -1,4 +1,4 @@ 
-/* { dg-options "-fno-tree-sra" } */
+/* { dg-options "-std=gnu17 -fno-tree-sra" } */
 typedef unsigned char byte;
 typedef unsigned int uint;
 typedef int bool;
diff --git a/gcc/testsuite/gcc.dg/torture/pr44807.c b/gcc/testsuite/gcc.dg/torture/pr44807.c
index 918333e2563..e5ccbaf2cd4 100644
--- a/gcc/testsuite/gcc.dg/torture/pr44807.c
+++ b/gcc/testsuite/gcc.dg/torture/pr44807.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 int sigemptyset (int *);
 int sigaddset(int, int);
diff --git a/gcc/testsuite/gcc.dg/torture/pr47281.c b/gcc/testsuite/gcc.dg/torture/pr47281.c
index 517e8548e3f..782710a7c1b 100644
--- a/gcc/testsuite/gcc.dg/torture/pr47281.c
+++ b/gcc/testsuite/gcc.dg/torture/pr47281.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 struct T;
 typedef void F(void);
diff --git a/gcc/testsuite/gcc.dg/torture/pr47958-1.c b/gcc/testsuite/gcc.dg/torture/pr47958-1.c
index 9fdf142fc99..d40ca0b3592 100644
--- a/gcc/testsuite/gcc.dg/torture/pr47958-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr47958-1.c
@@ -1,4 +1,5 @@ 
 /* { dg-do assemble } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 void (*foo[6][6]) (int);
 void bar (hdR)
diff --git a/gcc/testsuite/gcc.dg/torture/pr48063.c b/gcc/testsuite/gcc.dg/torture/pr48063.c
index d861bf04c80..ff6960f089c 100644
--- a/gcc/testsuite/gcc.dg/torture/pr48063.c
+++ b/gcc/testsuite/gcc.dg/torture/pr48063.c
@@ -1,6 +1,6 @@ 
 /* PR tree-optimization/48063 */
 /* { dg-do compile } */
-/* { dg-options "-fno-early-inlining" } */
+/* { dg-options "-std=gnu17 -fno-early-inlining" } */
 
 extern void abort (void);
 static void bar ();
diff --git a/gcc/testsuite/gcc.dg/torture/pr57036-1.c b/gcc/testsuite/gcc.dg/torture/pr57036-1.c
index ac6bc6b9df2..6e2171bf4d2 100644
--- a/gcc/testsuite/gcc.dg/torture/pr57036-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr57036-1.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 extern void g (void);
 int _setjmp();
diff --git a/gcc/testsuite/gcc.dg/torture/pr57330.c b/gcc/testsuite/gcc.dg/torture/pr57330.c
index 3e6cbcbd28c..d466a8fb26e 100644
--- a/gcc/testsuite/gcc.dg/torture/pr57330.c
+++ b/gcc/testsuite/gcc.dg/torture/pr57330.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 void foo (int a)
 {}
diff --git a/gcc/testsuite/gcc.dg/torture/pr57584.c b/gcc/testsuite/gcc.dg/torture/pr57584.c
index e4affb2e461..2398089d755 100644
--- a/gcc/testsuite/gcc.dg/torture/pr57584.c
+++ b/gcc/testsuite/gcc.dg/torture/pr57584.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 /* { dg-require-effective-target int32plus } */
 /* { dg-require-effective-target label_values } */
 /* { dg-require-effective-target indirect_jumps } */
diff --git a/gcc/testsuite/gcc.dg/torture/pr67741.c b/gcc/testsuite/gcc.dg/torture/pr67741.c
index c0019d04a86..5c0756c09a4 100644
--- a/gcc/testsuite/gcc.dg/torture/pr67741.c
+++ b/gcc/testsuite/gcc.dg/torture/pr67741.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 struct singlecomplex { float real, imag ; } ;
 struct doublecomplex { double real, imag ; } ;
diff --git a/gcc/testsuite/gcc.dg/torture/pr68104.c b/gcc/testsuite/gcc.dg/torture/pr68104.c
index 5db0282cdc7..a886d114e42 100644
--- a/gcc/testsuite/gcc.dg/torture/pr68104.c
+++ b/gcc/testsuite/gcc.dg/torture/pr68104.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 typedef struct
 {
diff --git a/gcc/testsuite/gcc.dg/torture/pr69242.c b/gcc/testsuite/gcc.dg/torture/pr69242.c
index d7f171810b9..2a50a167d1a 100644
--- a/gcc/testsuite/gcc.dg/torture/pr69242.c
+++ b/gcc/testsuite/gcc.dg/torture/pr69242.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-additional-options "-w" } */
+/* { dg-additional-options "-std=gnu17 -w" } */
 
 int a[1];
 void *memcpy();
diff --git a/gcc/testsuite/gcc.dg/torture/pr70457.c b/gcc/testsuite/gcc.dg/torture/pr70457.c
index 74daed4d36f..d2311578bdf 100644
--- a/gcc/testsuite/gcc.dg/torture/pr70457.c
+++ b/gcc/testsuite/gcc.dg/torture/pr70457.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 /* This formerly ICEd when trying to expand pow as a built-in with
    the wrong number of arguments.  */
diff --git a/gcc/testsuite/gcc.dg/torture/pr70985.c b/gcc/testsuite/gcc.dg/torture/pr70985.c
index 17273b029a4..33e7540993d 100644
--- a/gcc/testsuite/gcc.dg/torture/pr70985.c
+++ b/gcc/testsuite/gcc.dg/torture/pr70985.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 /* { dg-require-effective-target int32plus } */
 
 struct
diff --git a/gcc/testsuite/gcc.dg/torture/pr71606.c b/gcc/testsuite/gcc.dg/torture/pr71606.c
index b0cc26ac771..f60c9ddf471 100644
--- a/gcc/testsuite/gcc.dg/torture/pr71606.c
+++ b/gcc/testsuite/gcc.dg/torture/pr71606.c
@@ -1,3 +1,5 @@ 
+/* { dg-options "-std=gnu17" } */
+
 _Complex a;
 void fn1 ();
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr71816.c b/gcc/testsuite/gcc.dg/torture/pr71816.c
index cc143fa6c7d..6d82acac05a 100644
--- a/gcc/testsuite/gcc.dg/torture/pr71816.c
+++ b/gcc/testsuite/gcc.dg/torture/pr71816.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 /* { dg-prune-output "\\\[-Wbuiltin-declaration-mismatch" } */
 
 void *ext2fs_resize_mem_p;
diff --git a/gcc/testsuite/gcc.dg/torture/pr77286.c b/gcc/testsuite/gcc.dg/torture/pr77286.c
index 0c0610050f1..d71acc6f80b 100644
--- a/gcc/testsuite/gcc.dg/torture/pr77286.c
+++ b/gcc/testsuite/gcc.dg/torture/pr77286.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 /* { dg-additional-options "-mavx2" { target x86_64-*-* i?86-*-* } } */
 
 typedef float real;
diff --git a/gcc/testsuite/gcc.dg/torture/pr77646.c b/gcc/testsuite/gcc.dg/torture/pr77646.c
index 1b1990037bf..94c58630a99 100644
--- a/gcc/testsuite/gcc.dg/torture/pr77646.c
+++ b/gcc/testsuite/gcc.dg/torture/pr77646.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 struct e {
     int (*f)();
diff --git a/gcc/testsuite/gcc.dg/torture/pr77677-2.c b/gcc/testsuite/gcc.dg/torture/pr77677-2.c
index 768ab12601c..4ba25f0c6fa 100644
--- a/gcc/testsuite/gcc.dg/torture/pr77677-2.c
+++ b/gcc/testsuite/gcc.dg/torture/pr77677-2.c
@@ -1,6 +1,6 @@ 
 /* PR ipa/77677 */
 /* { dg-do compile } */
-/* { dg-options "-fpermissive -w" } */
+/* { dg-options "-std=gnu17 -fpermissive -w" } */
 
 enum machine_mode { MAX_MACHINE_MODE };
 
diff --git a/gcc/testsuite/gcc.dg/torture/pr78365.c b/gcc/testsuite/gcc.dg/torture/pr78365.c
index 5180a0171ae..a7ba4f3b405 100644
--- a/gcc/testsuite/gcc.dg/torture/pr78365.c
+++ b/gcc/testsuite/gcc.dg/torture/pr78365.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 int a, b, c;
 char d;
diff --git a/gcc/testsuite/gcc.dg/torture/pr79732.c b/gcc/testsuite/gcc.dg/torture/pr79732.c
index ed2695bf267..90a17331e8f 100644
--- a/gcc/testsuite/gcc.dg/torture/pr79732.c
+++ b/gcc/testsuite/gcc.dg/torture/pr79732.c
@@ -1,4 +1,5 @@ 
 /* { dg-do link } */
+/* { dg-options "-std=gnu17" } */
 /* { dg-require-alias "" } */
 
 int bar () __attribute__ ((alias ("foo")));
diff --git a/gcc/testsuite/gcc.dg/torture/pr80612.c b/gcc/testsuite/gcc.dg/torture/pr80612.c
index e648e82559c..356993e6222 100644
--- a/gcc/testsuite/gcc.dg/torture/pr80612.c
+++ b/gcc/testsuite/gcc.dg/torture/pr80612.c
@@ -1,5 +1,6 @@ 
 /* PR tree-optimization/80612 */
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 struct obstack *a;
 struct obstack {
diff --git a/gcc/testsuite/gcc.dg/torture/pr80764.c b/gcc/testsuite/gcc.dg/torture/pr80764.c
index bc6d8e87ac3..9d3fd4e71e1 100644
--- a/gcc/testsuite/gcc.dg/torture/pr80764.c
+++ b/gcc/testsuite/gcc.dg/torture/pr80764.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 int b, d, f, h;
 char e;
diff --git a/gcc/testsuite/gcc.dg/torture/pr80842.c b/gcc/testsuite/gcc.dg/torture/pr80842.c
index 600e8ce13ae..330d8bca72d 100644
--- a/gcc/testsuite/gcc.dg/torture/pr80842.c
+++ b/gcc/testsuite/gcc.dg/torture/pr80842.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 unsigned a;
 short b;
diff --git a/gcc/testsuite/gcc.dg/torture/pr81900.c b/gcc/testsuite/gcc.dg/torture/pr81900.c
index 9e4e8f4a7ca..2936f1de4a8 100644
--- a/gcc/testsuite/gcc.dg/torture/pr81900.c
+++ b/gcc/testsuite/gcc.dg/torture/pr81900.c
@@ -1,7 +1,7 @@ 
 /* PR/81900 */
 /* { dg-do compile } */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
-/* { dg-options "-fdump-tree-optimized" } */
+/* { dg-options "-std=gnu17 -fdump-tree-optimized" } */
 
 void Perl_croak() __attribute__((noreturn));
 char *Perl_sv_gets();
diff --git a/gcc/testsuite/gcc.dg/torture/pr82276.c b/gcc/testsuite/gcc.dg/torture/pr82276.c
index 2f9efc8b914..23e080db224 100644
--- a/gcc/testsuite/gcc.dg/torture/pr82276.c
+++ b/gcc/testsuite/gcc.dg/torture/pr82276.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 typedef struct a {
   struct a *b;
diff --git a/gcc/testsuite/gcc.dg/torture/pr84803.c b/gcc/testsuite/gcc.dg/torture/pr84803.c
index 81aad626d6c..ef07fee46c8 100644
--- a/gcc/testsuite/gcc.dg/torture/pr84803.c
+++ b/gcc/testsuite/gcc.dg/torture/pr84803.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-std=gnu17" } */
 
 long a;
 long *b;
diff --git a/gcc/testsuite/gcc.dg/torture/pr93124.c b/gcc/testsuite/gcc.dg/torture/pr93124.c
index 0d361d8c7cf..e654ab83309 100644
--- a/gcc/testsuite/gcc.dg/torture/pr93124.c
+++ b/gcc/testsuite/gcc.dg/torture/pr93124.c
@@ -1,4 +1,4 @@ 
-/* { dg-additional-options "-fno-rerun-cse-after-loop -fno-guess-branch-probability -fno-tree-fre" } */
+/* { dg-additional-options "-std=gnu17 -fno-rerun-cse-after-loop -fno-guess-branch-probability -fno-tree-fre" } */
 /* { dg-require-effective-target alloca } */
 
 int x;
diff --git a/gcc/testsuite/gcc.dg/torture/pr97330-1.c b/gcc/testsuite/gcc.dg/torture/pr97330-1.c
index 7dce5bd90d4..5164f00e2aa 100644
--- a/gcc/testsuite/gcc.dg/torture/pr97330-1.c
+++ b/gcc/testsuite/gcc.dg/torture/pr97330-1.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-options "-Wno-old-style-definition" } */
 
 typedef int a;
 typedef char b;
diff --git a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
index baed1e3fa78..322ebf7f7ba 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/comp-goto-1.c
@@ -1,6 +1,6 @@ 
 /* { dg-require-effective-target freorder } */
 /* { dg-require-effective-target label_values } */
-/* { dg-options "-O2 -freorder-blocks-and-partition" } */
+/* { dg-options "-std=gnu17 -O2 -freorder-blocks-and-partition" } */
 /* { dg-require-stack-size "4000" } */
 
 #include <stdlib.h>
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
index ce50af26a7c..9fa3a88408a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030703-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
 
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
index 8b7ab985bd3..9910c7902d7 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030708-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
 extern void abort (void);
 struct rtx_def;
 typedef struct rtx_def *rtx;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
index 78938f919d4..e228400c97b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030709-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O -fdump-tree-dce3" } */
+/* { dg-options "-Wno-old-style-definition -O -fdump-tree-dce3" } */
   
 struct rtx_def;
 typedef struct rtx_def *rtx;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
index 838317de293..2c9920ae039 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030709-3.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
   
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
index 529c79b26e3..11391e6ee6a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030710-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-copyprop2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-copyprop2" } */
 
 extern void abort (void);
 extern void blah (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
index 080ccfa8382..c3f75eff29e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
  
 extern void abort (void);
 extern void blah (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
index 7fce5ab4b66..6f3c8c303b7 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-dom2" } */
   
 
 struct rtx_def;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
index 15d7e973041..f5b0a14837e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-3.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
   
 
 struct rtx_def;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
index 9f0daac22dc..ad1b8ad791b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
    
 struct rtx_def;
 typedef struct rtx_def *rtx;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
index 9585ff11307..a3b564da368 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
    
 
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
index 7c1fea7dfbb..10ed817d570 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030728-1.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-rtl-expand-details" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-rtl-expand-details" } */
     
 
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c
index 0e01e511b78..939dbaec2ea 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-10.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-vrp1" } */
      
 
 extern const unsigned char mode_size[];
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
index 6effbb7ffe5..e7e73cb4502 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-11.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
 
 extern void abort (void);
 struct rtx_def;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
index bba3569c76f..1097798158a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-3.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2" } */
                                                                                 
 typedef unsigned int cppchar_t;
 void foo (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c
index e680de8bdee..1453df6eeb0 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-6.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-vrp1" } */
      
 
 void
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c b/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
index ca06f712890..857191de16e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030807-7.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-vrp1" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-vrp1" } */
   
 extern void abort (void);
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
index e59b3e346c2..53a2d01763a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-4.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
     
 extern void abort (void);
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
index 1b0bef1d3e0..986540ca1bc 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-5.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fdump-tree-dom2 -fdump-tree-optimized" } */
     
 extern void abort (void);
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c b/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
index e4b8d43d299..d147dff6f08 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030814-6.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O1 -fno-tree-fre -fdump-tree-dom2" } */
+/* { dg-options "-Wno-old-style-definition -O1 -fno-tree-fre -fdump-tree-dom2" } */
 
 extern void abort (void);
 union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
index 719ea65f5bf..271f0a5760f 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030918-1.c
@@ -2,7 +2,7 @@ 
    references after propagating &equot[0] into p.  */
 
 /* { dg-do compile } */
-/* { dg-options "-O -ftree-dominator-opts" } */
+/* { dg-options "-Wno-old-style-definition -O -ftree-dominator-opts" } */
 
 static unsigned short equot[(6 +3)];
 int
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c
index 11f76671604..5ec48e3da95 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040514-2.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fdump-tree-phiopt1" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-phiopt1" } */
 int
 foo2 (distance, i, j)
      int distance;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c b/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c
index 52903dde497..746100836f3 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/loadpre7.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */ 
-/* { dg-options "-O2 -fdump-tree-pre-stats" } */
+/* { dg-options "-Wno-old-style-definition -O2 -fdump-tree-pre-stats" } */
 /* We can't eliminate the *p load here in any sane way, as eshup8 may 
    change it.  */
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr111003.c b/gcc/testsuite/gcc.dg/tree-ssa/pr111003.c
index a520765dd9f..59d3a966662 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr111003.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr111003.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O3 -fdump-tree-optimized" } */
+/* { dg-options "-std=gnu17 -O3 -fdump-tree-optimized" } */
 
 static int c, d, e, f;
 static short g;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c b/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c
index 14bd4dbd6e5..278843019b2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr115128.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O3 -w" } */
+/* { dg-options "-std=gnu17 -O3 -w" } */
 
 long XXH3_len_4to8_64b_len, XXH3_len_0to16_64b___trans_tmp_3, XXH3_mix2Accs_acc,
     XXH3_64bits_internal___trans_tmp_8;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr115191.c b/gcc/testsuite/gcc.dg/tree-ssa/pr115191.c
index 43f780aa3b8..fe0c1321883 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr115191.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr115191.c
@@ -1,5 +1,5 @@ 
 // { dg-do compile }
-// { dg-options "-O1 -w" }
+// { dg-options "-std=gnu17 -O1 -w" }
 
 typedef void *SCM;
 void set_socket_io_ports();
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c b/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c
index 0ce9ed3a620..b749151d503 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr24840.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 typedef struct
 {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr69666.c b/gcc/testsuite/gcc.dg/tree-ssa/pr69666.c
index 9be77ea1523..220c0cde15b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr69666.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr69666.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -w" } */
+/* { dg-options "-std=gnu17 -O2 -w" } */
 
 int a, c, d;
 float b;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c b/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c
index d636672fddc..6873f87bcce 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr70232.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -w -fdump-tree-vrp1-details -fdump-tree-vrp2-details -fdump-tree-dom2-details -fdump-tree-dom3-details" } */
+/* { dg-options "-std=gnu17 -O2 -w -fdump-tree-vrp1-details -fdump-tree-vrp2-details -fdump-tree-dom2-details -fdump-tree-dom3-details" } */
 
 /* All the threads found by the threader should have too many
    statements to be profitable.  */
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr79757-1.c b/gcc/testsuite/gcc.dg/ubsan/pr79757-1.c
index ca074bcff46..20ed2cdb93f 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr79757-1.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr79757-1.c
@@ -1,7 +1,7 @@ 
 /* PR sanitizer/79757 */
 /* { dg-do compile } */
 /* { dg-require-effective-target int128 } */
-/* { dg-options "-fsanitize=undefined" } */
+/* { dg-options "-Wno-old-style-definition -fsanitize=undefined" } */
 
 unsigned __int128 x, y;
 
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr79757-2.c b/gcc/testsuite/gcc.dg/ubsan/pr79757-2.c
index b3e1939a547..32e38c11ef0 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr79757-2.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr79757-2.c
@@ -1,7 +1,7 @@ 
 /* PR sanitizer/79757 */
 /* { dg-do compile } */
 /* { dg-require-effective-target int128 } */
-/* { dg-options "-fsanitize=undefined" } */
+/* { dg-options "-Wno-old-style-definition -fsanitize=undefined" } */
 
 unsigned __int128 x, y;
 
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr79757-3.c b/gcc/testsuite/gcc.dg/ubsan/pr79757-3.c
index 22fe3deef2d..7eb3fee54ce 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr79757-3.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr79757-3.c
@@ -1,7 +1,7 @@ 
 /* PR sanitizer/79757 */
 /* { dg-do compile } */
 /* { dg-require-effective-target int128 } */
-/* { dg-options "-fsanitize=undefined" } */
+/* { dg-options "-Wno-old-style-definition -fsanitize=undefined" } */
 
 unsigned __int128 x, y;
 
diff --git a/gcc/testsuite/gcc.dg/ubsan/pr81223.c b/gcc/testsuite/gcc.dg/ubsan/pr81223.c
index e7aff5243e6..f72b1cda809 100644
--- a/gcc/testsuite/gcc.dg/ubsan/pr81223.c
+++ b/gcc/testsuite/gcc.dg/ubsan/pr81223.c
@@ -1,6 +1,6 @@ 
 /* PR sanitizer/81223 */
 /* { dg-do compile } */
-/* { dg-options "-fsanitize=undefined" } */
+/* { dg-options "-std=gnu17 -fsanitize=undefined" } */
 
 void bar ();
 
diff --git a/gcc/testsuite/gcc.dg/uninit-10-O0.c b/gcc/testsuite/gcc.dg/uninit-10-O0.c
index f761ac91c41..18fe56cd26c 100644
--- a/gcc/testsuite/gcc.dg/uninit-10-O0.c
+++ b/gcc/testsuite/gcc.dg/uninit-10-O0.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-Wall" } */
+/* { dg-options "-Wno-old-style-definition -Wall" } */
 /* On Alpha EV4, dead code elimination and cfg simplification conspired
    to leave the register containing 'C' marked live, though all references
    to the variable had been removed.  */
diff --git a/gcc/testsuite/gcc.dg/uninit-10.c b/gcc/testsuite/gcc.dg/uninit-10.c
index 0d62020df9f..e2396a5e18a 100644
--- a/gcc/testsuite/gcc.dg/uninit-10.c
+++ b/gcc/testsuite/gcc.dg/uninit-10.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wall" } */
+/* { dg-options "-Wno-old-style-definition -O2 -Wall" } */
 /* On Alpha EV4, dead code elimination and cfg simplification conspired
    to leave the register containing 'C' marked live, though all references
    to the variable had been removed.  */
diff --git a/gcc/testsuite/gcc.dg/uninit-32.c b/gcc/testsuite/gcc.dg/uninit-32.c
index cf9efa0f064..586b6355f43 100644
--- a/gcc/testsuite/gcc.dg/uninit-32.c
+++ b/gcc/testsuite/gcc.dg/uninit-32.c
@@ -1,7 +1,7 @@ 
 /* PR middle-end/10138 - warn for uninitialized arrays passed as const*
    arguments
    { dg-do compile }
-   { dg-options "-O -Wall" }
+   { dg-options "-std=gnu17 -O -Wall" }
    { dg-require-effective-target alloca } */
 
 typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/uninit-41.c b/gcc/testsuite/gcc.dg/uninit-41.c
index f2e17a81d09..2f138cb8e5c 100644
--- a/gcc/testsuite/gcc.dg/uninit-41.c
+++ b/gcc/testsuite/gcc.dg/uninit-41.c
@@ -1,7 +1,7 @@ 
 /* Verify that calls to non-modifying built-ins aren't considered
    potentially modifying.
    { dg-do compile }
-   { dg-options "-O2 -Wall" }
+   { dg-options "-std=gnu17 -O2 -Wall" }
    { dg-require-effective-target alloca } */
 
 typedef __SIZE_TYPE__ size_t;
diff --git a/gcc/testsuite/gcc.dg/uninit-A-O0.c b/gcc/testsuite/gcc.dg/uninit-A-O0.c
index 69376911563..c1f1a1cd6c7 100644
--- a/gcc/testsuite/gcc.dg/uninit-A-O0.c
+++ b/gcc/testsuite/gcc.dg/uninit-A-O0.c
@@ -2,7 +2,7 @@ 
    May be a real bug in CSE. */
 
 /* { dg-do compile } */
-/* { dg-options "-Wall" } */
+/* { dg-options "-Wno-old-style-definition -Wall" } */
 
 struct tree
 {
diff --git a/gcc/testsuite/gcc.dg/uninit-A.c b/gcc/testsuite/gcc.dg/uninit-A.c
index 28f7fe9fcf4..2adc374fbed 100644
--- a/gcc/testsuite/gcc.dg/uninit-A.c
+++ b/gcc/testsuite/gcc.dg/uninit-A.c
@@ -2,7 +2,7 @@ 
    May be a real bug in CSE. */
 
 /* { dg-do compile } */
-/* { dg-options "-O2 -Wall" } */
+/* { dg-options "-O2 -Wall -Wno-old-style-definition" } */
 
 struct tree
 {
diff --git a/gcc/testsuite/gcc.dg/unused-1.c b/gcc/testsuite/gcc.dg/unused-1.c
index 8db7c2ccfff..2cc86c04faa 100644
--- a/gcc/testsuite/gcc.dg/unused-1.c
+++ b/gcc/testsuite/gcc.dg/unused-1.c
@@ -2,7 +2,7 @@ 
    egcs-1.1.2 fails, egcs-ss-19990418 passes.
    http://gcc.gnu.org/ml/gcc-bugs/1998-09/msg00199.html */
 /* { dg-do compile } */
-/* { dg-options "-O -Wall -W" } */
+/* { dg-options "-Wno-old-style-definition -O -Wall -W" } */
 int
 f(c)
      char c; /* { dg-warning "unused parameter" "unused parameter warning" } */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr114249.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr114249.c
index 64c93cd9a2d..36ccb2c0e94 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pr114249.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr114249.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 enum { SEG_THIN_POOL } read_only;
 struct {
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pr97486.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pr97486.c
index 17d48a7fe69..fceb93367b6 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pr97486.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pr97486.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 
 struct {
   int *end_info;
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-1.c b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-1.c
index bea3b92ba77..dd3f91be4d2 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-1.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-1.c
@@ -1,3 +1,4 @@ 
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target vect_int } */
 /* PR tree-optimization/67682.  */
 
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c
index 9431bcb9d5c..2ee50039af3 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-2.c
@@ -1,3 +1,4 @@ 
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target vect_int } */
 /* { dg-require-effective-target vect_perm } */
 /* PR tree-optimization/67682.  */
diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-3.c b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-3.c
index d1d79125731..1b3d5d99eca 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-3.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-subgroups-3.c
@@ -1,3 +1,4 @@ 
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target vect_int } */
 /* { dg-require-effective-target vect_int_mult } */
 /* PR tree-optimization/67682.  */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_111-pr113731.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_111-pr113731.c
index b205f470660..05edf59bec8 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_111-pr113731.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_111-pr113731.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
 /* { dg-require-effective-target vect_long } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-early-break_122-pr114239.c b/gcc/testsuite/gcc.dg/vect/vect-early-break_122-pr114239.c
index 7bf4db14209..eea47f73e94 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-early-break_122-pr114239.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-early-break_122-pr114239.c
@@ -1,4 +1,5 @@ 
 /* { dg-do compile } */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-add-options vect_early_break } */
 /* { dg-require-effective-target vect_early_break } */
 
diff --git a/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c b/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c
index 033c3587f1b..d914b88d731 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-multi-peel-gaps.c
@@ -6,6 +6,7 @@ 
    increment by 2 integers at a time, hence the last load needs s[30-33] and
    the penultimate load needs s[28-31].
    This testcase ensures that we do not crash due to that behaviour.  */
+/* { dg-additional-options "-std=gnu17" } */
 /* { dg-require-effective-target mmap } */
 #include <sys/mman.h>
 #include <stdio.h>
diff --git a/gcc/testsuite/gcc.dg/vla-stexp-2.c b/gcc/testsuite/gcc.dg/vla-stexp-2.c
index 9f1512567f0..8616ef75d09 100644
--- a/gcc/testsuite/gcc.dg/vla-stexp-2.c
+++ b/gcc/testsuite/gcc.dg/vla-stexp-2.c
@@ -1,6 +1,6 @@ 
 /* PR101838 */
 /* { dg-do run } */
-/* { dg-options "-Wpedantic -O0" } */
+/* { dg-options "-std=gnu17 -Wpedantic -O0" } */
 /* { dg-require-effective-target alloca } */
 
 
diff --git a/gcc/testsuite/gcc.dg/warn-1.c b/gcc/testsuite/gcc.dg/warn-1.c
index 6db4ae5cd6c..d5acca2b9ae 100644
--- a/gcc/testsuite/gcc.dg/warn-1.c
+++ b/gcc/testsuite/gcc.dg/warn-1.c
@@ -1,7 +1,7 @@ 
 /* The compiler used to say passing arg 0 of, which is wrong.  */
 /* Radar 3069179 */
 
-/* { dg-options "-O3" } */
+/* { dg-options "-Wno-old-style-definition -O3" } */
 
 static void foo (p)
      int p;
diff --git a/gcc/testsuite/gcc.dg/winline-10.c b/gcc/testsuite/gcc.dg/winline-10.c
index 2df5addaebc..f4d92fae8c5 100644
--- a/gcc/testsuite/gcc.dg/winline-10.c
+++ b/gcc/testsuite/gcc.dg/winline-10.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -Winline -fopt-info-optimized-inline=stderr" } */
+/* { dg-options "-Wno-old-style-definition -O2 -Winline -fopt-info-optimized-inline=stderr" } */
 
 struct s { int a; };
 
diff --git a/gcc/testsuite/gcc.dg/wtr-label-1.c b/gcc/testsuite/gcc.dg/wtr-label-1.c
index 78a4d6b0a4b..bd31d925b77 100644
--- a/gcc/testsuite/gcc.dg/wtr-label-1.c
+++ b/gcc/testsuite/gcc.dg/wtr-label-1.c
@@ -2,7 +2,7 @@ 
    Note, gcc should omit these warnings in system header files.
    Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/24/2000.  */
 /* { dg-do compile } */
-/* { dg-options "-Wtraditional" } */
+/* { dg-options "-Wno-old-style-definition -Wtraditional" } */
 
 enum foo1 { a };
 struct foo2 { int i; };
diff --git a/gcc/testsuite/gcc.dg/wtr-switch-1.c b/gcc/testsuite/gcc.dg/wtr-switch-1.c
index f0381bc5e37..56913ea11a9 100644
--- a/gcc/testsuite/gcc.dg/wtr-switch-1.c
+++ b/gcc/testsuite/gcc.dg/wtr-switch-1.c
@@ -2,7 +2,7 @@ 
    Note, gcc should omit these warnings in system header files.
    By Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 8/22/2000.  */
 /* { dg-do compile } */
-/* { dg-options "-Wtraditional" } */
+/* { dg-options "-Wno-old-style-definition -Wtraditional" } */
 
 void
 testfunc (l)
diff --git a/gcc/testsuite/gcc.target/i386/excess-precision-3.c b/gcc/testsuite/gcc.target/i386/excess-precision-3.c
index e8e9abc6957..06f24894160 100644
--- a/gcc/testsuite/gcc.target/i386/excess-precision-3.c
+++ b/gcc/testsuite/gcc.target/i386/excess-precision-3.c
@@ -1,7 +1,7 @@ 
 /* Excess precision tests.  Test excess precision is removed when
    necessary.  */
 /* { dg-do run } */
-/* { dg-options "-O2 -mfpmath=387 -fexcess-precision=standard" } */
+/* { dg-options "-Wno-old-style-definition -O2 -mfpmath=387 -fexcess-precision=standard" } */
 
 #include <float.h>
 #include <stdarg.h>
diff --git a/gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c b/gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c
index 385cd950b97..ef0cf41feaa 100644
--- a/gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c
+++ b/gcc/testsuite/gcc.target/i386/fma4-256-nmsubXX.c
@@ -1,6 +1,6 @@ 
 /* { dg-do run } */
 /* { dg-require-effective-target fma4 } */
-/* { dg-options "-O2 -mfma4" } */
+/* { dg-options "-std=gnu17 -O2 -mfma4" } */
 
 #include "fma4-check.h"
 
diff --git a/gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c b/gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c
index c0bce417e11..82431ea4614 100644
--- a/gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c
+++ b/gcc/testsuite/gcc.target/i386/fma4-nmsubXX.c
@@ -1,6 +1,6 @@ 
 /* { dg-do run } */
 /* { dg-require-effective-target fma4 } */
-/* { dg-options "-O0 -mfma4" } */
+/* { dg-options "-std=gnu17 -O0 -mfma4" } */
 
 #include "fma4-check.h"
 
diff --git a/gcc/testsuite/gcc.target/i386/nop-mcount.c b/gcc/testsuite/gcc.target/i386/nop-mcount.c
index a5f8d27fda4..ee3c97f3a57 100644
--- a/gcc/testsuite/gcc.target/i386/nop-mcount.c
+++ b/gcc/testsuite/gcc.target/i386/nop-mcount.c
@@ -1,7 +1,7 @@ 
 /* Test -mnop-mcount */
 /* { dg-do compile { target { *-*-linux* && nonpic } } } */
 /* { dg-require-effective-target mfentry } */
-/* { dg-options "-pg -mfentry -mrecord-mcount -mnop-mcount" } */
+/* { dg-options "-Wno-old-style-definition -pg -mfentry -mrecord-mcount -mnop-mcount" } */
 /* { dg-final { scan-assembler-not "__fentry__" } } */
 /* Origin: Andi Kleen */
 extern void foobar(char *);
diff --git a/gcc/testsuite/gcc.target/i386/pr102627.c b/gcc/testsuite/gcc.target/i386/pr102627.c
index 8ab9acaf002..7e140923644 100644
--- a/gcc/testsuite/gcc.target/i386/pr102627.c
+++ b/gcc/testsuite/gcc.target/i386/pr102627.c
@@ -1,6 +1,6 @@ 
 /* PR rtl-optimization/102627 */
 /* { dg-do run } */
-/* { dg-options "-O1" } */
+/* { dg-options "-std=gnu17 -O1" } */
 
 int a, f, l, m, q, c, d, g;
 long b, e;
diff --git a/gcc/testsuite/gcc.target/i386/pr106994.c b/gcc/testsuite/gcc.target/i386/pr106994.c
index 0803311dc75..b0bf9856d19 100644
--- a/gcc/testsuite/gcc.target/i386/pr106994.c
+++ b/gcc/testsuite/gcc.target/i386/pr106994.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-march=skylake -Ofast" } */
+/* { dg-options "-std=gnu17 -march=skylake -Ofast" } */
 
 typedef struct {
   float ymin, ymax;
diff --git a/gcc/testsuite/gcc.target/i386/pr68349.c b/gcc/testsuite/gcc.target/i386/pr68349.c
index 3c38c3a01f3..b8540e4948b 100644
--- a/gcc/testsuite/gcc.target/i386/pr68349.c
+++ b/gcc/testsuite/gcc.target/i386/pr68349.c
@@ -1,6 +1,6 @@ 
 /* PR target/68483 */
 /* { dg-do compile } */
-/* { dg-options "-O2" } */
+/* { dg-options "-std=gnu17 -O2" } */
 
 int a, b;
 unsigned long my_strlen();
diff --git a/gcc/testsuite/gcc.target/i386/pr97313.c b/gcc/testsuite/gcc.target/i386/pr97313.c
index 711766b4132..6167a1ff075 100644
--- a/gcc/testsuite/gcc.target/i386/pr97313.c
+++ b/gcc/testsuite/gcc.target/i386/pr97313.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O2 -fPIE" } */
+/* { dg-options "-std=gnu17 -O2 -fPIE" } */
 /* { dg-require-effective-target pie } */
 
 typedef struct {
diff --git a/gcc/testsuite/gcc.target/i386/pr99454.c b/gcc/testsuite/gcc.target/i386/pr99454.c
index ba3ffe2cab3..f46d56da0be 100644
--- a/gcc/testsuite/gcc.target/i386/pr99454.c
+++ b/gcc/testsuite/gcc.target/i386/pr99454.c
@@ -1,5 +1,5 @@ 
 /* { dg-do compile } */
-/* { dg-options "-O -w" } */
+/* { dg-options "-std=gnu17 -O -w" } */
 
 struct skb_shared_info {
   short gso_size;
diff --git a/gcc/testsuite/gcc.target/i386/record-mcount.c b/gcc/testsuite/gcc.target/i386/record-mcount.c
index 05b4bcba711..52924e0f214 100644
--- a/gcc/testsuite/gcc.target/i386/record-mcount.c
+++ b/gcc/testsuite/gcc.target/i386/record-mcount.c
@@ -1,6 +1,6 @@ 
 /* Test -mrecord-mcount */
 /* { dg-do compile { target { *-*-linux* && nonpic } } } */
-/* { dg-options "-pg -mrecord-mcount" } */
+/* { dg-options "-Wno-old-style-definition -pg -mrecord-mcount" } */
 /* { dg-final { scan-assembler "mcount_loc" } } */
 /* Origin: Andi Kleen */
 extern void foobar(char *);
diff --git a/libffi/testsuite/libffi.call/va_struct2.c b/libffi/testsuite/libffi.call/va_struct2.c
index 56f5b9c75fa..49359be712c 100644
--- a/libffi/testsuite/libffi.call/va_struct2.c
+++ b/libffi/testsuite/libffi.call/va_struct2.c
@@ -33,6 +33,7 @@  test_fn (int n, ...)
   struct small_tag s2;
   struct large_tag l;
 
+  (void) n;
   va_start (ap, n);
   s1 = va_arg (ap, struct small_tag);
   l = va_arg (ap, struct large_tag);
diff --git a/libffi/testsuite/libffi.call/va_struct3.c b/libffi/testsuite/libffi.call/va_struct3.c
index 9a27e7fd4a3..c30f9af8894 100644
--- a/libffi/testsuite/libffi.call/va_struct3.c
+++ b/libffi/testsuite/libffi.call/va_struct3.c
@@ -33,6 +33,7 @@  test_fn (int n, ...)
   struct small_tag s2;
   struct large_tag l;
 
+  (void) n;
   va_start (ap, n);
   s1 = va_arg (ap, struct small_tag);
   l = va_arg (ap, struct large_tag);