This is the mail archive of the
java-patches@sources.redhat.com
mailing list for the Java project.
Re: [PATCH] Cleanup patches to build libgcj on x86/linux
Alexandre Petit-Bianco wrote:
> Bryce McKinlay writes:
>
> > My guess is that the compiler is correct and the declarations in
> > gc_mark.h are simply not legal in C++.
>
> PRobably. But it seems incredible that the C++ compiler never
> complained about anything -- which is why I thought we had a way to
> turn the complains off that was now broken.
gcc has traditionally been fairly relaxed about many of the C++ type
checking rules, and many of those rules only got made up fairly recently
with the advent of standard (iso) C++. We've had to tweak libgcj several
times in the past as the compiler gradually implements the spec more
precisely.
FWIW, I checked and the book clearly states that what we try to do in
boehm.cc is illegal. from S9.2.4, Stroustrup 3rd ed):
"An extern "C" directive specifies the linkage convention (only) and
does not affect the semantics of the function. In particular, a function
declared extern "C" still obeys the C++ type checking and argument
conversion rules and not the weaker C rules."
So the compiler is correct, and making maybe_mark into an `extern
"C" inline' function won't work either.
The only reasonable fix as far as I can tell is to fix the GC's headers
and get rid of function declarations without a parameter list (or else
find a way to not use private GC headers from our marking function!).
regards
[ bryce ]