Re: problem in gcc (lib) headers __BEGIN_DECLS & traceback-incomplete

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8 March 2017 at 00:23, L A Walsh wrote:
> Jonathan Wakely wrote:
>
>> Reduce your code to the minimum necessary to show the problem, and
>> paste that here. If as you say, there is nothing before the includes,
>> you shouldn't need to paste any of your code, just two files
>> containing nothing but include directives. We can't reliably guess
>> what your code does.
>
> ----
>
> Here it is, there is a source error in a .h file, but it and an include of
> '<cassert>' were behind 2-3 levels of includes.  In this case, the missing
> '}' is shown immediately after the __BEGIN_DECLS prob, but it wasn't that
> way with all the other includes (if it was shown at all).
>
> So why doesn't it show the missing '}' before the __BEGIN_DECLS error when
> the missing '}' occurs before the include of cassert?

Because it's valid to do:

struct X {
#include "foo.h"
};

Or even:

struct Y {
#include "bar.h"

where the closing brace is in bar.h

So the compiler can't give an error before the include, because the
header might provide the closing brace.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux