[GCC-XML]Wrong output in version 0.4.1?
Nicodemus
nicodemus at globalite.com.br
Fri Feb 21 10:47:04 EST 2003
Hi Brad, thanks for replying.
Brad King wrote:
>I'm looking into this. It is likely that it has to do with the bugfix
>that was done in the 0.4.1 release. The "fix" might have revealed another
>bug. Thanks for reporting this.
>
You're welcome. Glad to help. 8)
>>I have another question: how can I simulate the Intel C++ compiler? The
>>homepage states that gccxml has support for it, and the name of the
>>compiler must be passed to the --gccxml-compiler flag. I tried icl,
>>intel, intelc++ and others without success. What's the correct name?
>>
>
>The documentation says that it supports the Intel PLUGIN to MSVC 6, which
>uses the Visual Studio standard library. Therefore, just use msvc6 as the
>compiler name, and the produced code will reflect what is seen by the
>plugin compiler. Support for intel's standalone compiler is not currently
>provided, but it probably added relatively easily. Contact me off the
>list if you are interested in persuing this.
>
I have the plugin for visual studio, but it doesn't seem to be
simulating it correctly. I tested it like this:
/* file test.h */
struct C
{
template <class D>
void foo()
{
D d;
}
template <>
void foo<int>()
{
int x;
}
};
void main()
{
C c;
c.foo<double>();
c.foo<int>();
}
/* end of test.h /*
In the command line:
] cl /Tp test.h /c
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for
80x86
> Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
>
> test.h
> test.h(57) : error C2062: type 'double' unexpected
> test.h(58) : error C2062: type 'int' unexpected
vc6 doesn't support template specialization.
] icl /Tp test.h /c
> Intel(R) C++ Compiler for 32-bit applications, Version 6.0 Build
020321Z
> Copyright (C) 1985-2002 Intel Corporation. All rights reserved.
>
> test.h
intel compiles it without problem.
] gccxml -fxml=out.xml test.h
> test.h:47: explicit specialization in non-namespace scope `struct C'
> test.h:48: invalid use of undefined type `struct C'
> test.h:40: forward declaration of `struct C'
> test.h:49: confused by earlier errors, bailing out
It seems that gccxml is simulating vc6, and not intel... but note that
I'm using intel c++ v6.0, and in the page says that support is for
version 5.0... but I believe that the version 5.0 supported template
specializations too.
>>Another question: I would like to make gccxml use STLport instead of the
>>default visual studio standard libraries. I pass the path to stlport
>>with the -I flag, but gccxml apparently includes the vc libraries first
>>by default. How can I change this behaviour?
>>
>
>That is an oversight in the implementation that no one has noticed until
>now. The compiler simulation flags are added first, and then the user
>flags. It should be the other way around. I've fixed this in the CVS
>head of the GCC-XML front-end. If you check it out from CVS (insturctions
>on web page), you can build it and still use the gccxml_cc1plus exectuable
>from 0.4.1.
>
>-Brad
>
>
Thanks again for the help, and congratulations for this great tool.
Farewell,
Nicodemus.
More information about the gccxml
mailing list