Re: GCC switch to C11 causes many testsuite compiler diagnostics

Joel Brobecker
2014-11-23T07:27:35Z

> Comparing my latest nios2 test results (with Pedro's thread patch)
> with those from a checkout a couple weeks old, I noticed I had some
> new ERRORs due to apparent compilation failures. I tracked this
> down to the recent change on GCC mainline (r216247) to make the
> default C dialect GNU11, which enables -Wimplicit-int and
> -Wimplicit-function-declaration by default. I started working on a
> patch to fix the offending testcases, but realized that there are
> hundreds of them. :-(
>
> So, before I invest a lot more time on this, is updating the GDB
> testsuite to use a more modern C dialect the Right Thing To Do? I'm
> also wondering if it's really necessary to support compilers that
> can't handle function prototypes in the testsuite (not defining
> PROTOTYPES seems to be the default, in fact).

Generally speaking, I don't see a problem with modifying the code
in testcases to conform to the new warnings, but we need to verify
that it does not undo something that was specifically done for that
testcase.

Perhaps what we could do instead, is look at compiling the code
with switches that turn those off by default in the testsuite
directory? (I think this could be done in gdb_compile?) Not completely
obvious, but perhaps less time-consuming and boring than doing
mechanical updates of a lot of testcases...

Before you go ahead and implement anything, you might want to wait
to see what others think of the idea. I wouldn't say that this is
obviously the best compromise...

--
Joel