treewide: use -std=gnu99

These days we rely on a bunch of C99 extensions (e.g. designated
initializers) and even C11 extensions (e.g. _Generic), but the kernel is
nominally C89 with GNU extensions, as we build with -std=gnu89.

One extension this doesn't include is for-loop initial declarations,
e.g.

	for (int i = 0; i < 10; i++) {
		printk("i is %d\n", i);
	}

In simple cases we can provide a prior declaration, e.g.

	int i;

	for (i = 0; i < 10; i++) {
		printk("i is %d\n", i);
	}

However, having the ability to declare variables scoped to the loop
itself would make a number of cases simpler, and would allow us to do
things that we cannot do today. For example, in combination with the GNU
`cleanup` attribute, it would allow for creating scopes with automatic
initialization and teardown, which could be used to implement
concurrency primitives which are more robust and easier to instrument,
e.g.

	seqcount_latch_write(&seq) {
		obj->a = foo;
		obj->b = bar;
	}

	seqcount_read_loop(&seq) {
		tmp_foo = obj->a;
	}

TODO: there are potentially subtle differences between C89 and C99 that
will need to be considered.

TODO: update translated documentation

TODO: check for other C89/GNU89/C99/GNU99 references throughout the
tree.

TODO: check architectures/configs.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
3 files changed