On Thu, Jul 9, 2020 at 12:35 PM Kirill A. Shutemov <kir...@shutemov.name> wrote: > > On Thu, Jul 09, 2020 at 11:30:27AM +0200, Arnd Bergmann wrote: > > The most interesting version to require in the future would be > > gcc-7, which IIRC is the point at which we can just use -std=gnu99 > > or -std=gnu11 instead of -std=gnu89 without running into the > > problem with compound literals[1]. > > It is gcc-5, not gcc-7. This commit: > > https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=d303aeafa9b4
Ok, glad I was wrong here. I confirmed that with gcc-5 or higher I can build a kernel with -std=gnu11 or -std=gnu99 instead of -std=gnu89, but gcc-4.9.4 fails with anything other than gnu89. I forgot why we care though -- is there any behavior of gnu11 that we prefer over the gnu99 behavior, or is it just going with the times because it's the right thing to do? All the interesting features of c11 seem to also be available as extensions in gcc-4.9's gnu89, though I could not find a definite list of the differences. Arnd