This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: C++ Darwin Port BUG in source code
On 2005-02-06, at 17:00, Andrew Pinski wrote:
On Feb 3, 2005, at 8:55 PM, Marcin Dalecki wrote:
I have found a serious bug in the darwin compiler port, which does
get unnoticed
due to linker errors. The problem is that there are two different
lookup_name() functions.
One is for C++ found in name-lookup[ch] and declared as:
extern tree lookup_name (tree, int);
and one if doe C and declared as:
extern tree lookup_name (tree);
Thus config/darwin-c.c, which is calling it inside
darwin_pragma_unused() will
link fine but call the wrong function with improper parameters when
implementing
#pragma unused. This is something that can't work properly.
Very likely the intention was to implement the pragma only for C.
Yes this is a bug, could you file a bug.
Most likely the problem is that there is no testcase for #pragma unused
for C++ (for darwin obviously) in the testsuite.
OK. I have just looked a bit further into it. What I have discovered
was the
following "nice pearl" in config.gcc:
tm_file="${tm_file} darwin.h"
tm_p_file="${tm_p_file} darwin-protos.h"
tmake_file="t-darwin t-slibgcc-darwin"
target_gtfiles="\$(srcdir)/config/darwin.c"
c_target_objs="darwin-c.o"
cxx_target_objs="darwin-c.o"
extra_parts="crt2.o"
extra_objs="darwin.o"
This is way off. It can't work. darwin-c.c is supposed to call in to the
C compiler frontend. Looking at the contents most of it should be moved
in to darwin.c and some parts should be in a new to be created
darwin-cxx.c.
That's indeed a can of worms there...