array typedef problem?
- From: rm <async cc gatech edu>
- To: orbitcpp-list gnome org
- Subject: array typedef problem?
- Date: Thu, 4 Sep 2003 22:05:37 -0400
hi,
i'm trying to declare an array with orbitcpp 1.3.7. if i
declare it at the module level, the generated files compile fine; if i
declare it at the interface level the generated header file makes gcc
unhappy.
// works ok
module Foo {
interface Bar {
};
typedef Bar BarArray[10];
interface BarPrime {
};
};
----------------------------------------
// syntax error
module Foo {
interface Bar {
};
interface BarPrime {
typedef Bar BarArray[10];
};
};
----------------------------------------------
/* test-server.cc */
#include "test.h"
#include "test-cpp.h"
#include "test-cpp-skels.h"
int
main(int argc, char ** argv)
{
CORBA::ORB_ptr orb = CORBA::ORB_init (argc, argv);
orb->run();
return 0;
}
-------------------------------------------
error from gcc 3.0.4
In file included from test-cpp.h:6,
from test-server.cc:4:
test-cpp-common.h:158: syntax error before `::' token
test-cpp-common.h:159: ISO C++ forbids declaration of `alloc' with no type
test-cpp-common.h:159: declaration of `int alloc()' not in a namespace
surrounding `::'
test-cpp-common.h:159: `int alloc()' should have been declared inside `::'
test-cpp-common.h: In function `int alloc()':
test-cpp-common.h:160: cannot convert `Foo::Bar_mgr*' to `int' in return
test-cpp-common.h: At global scope:
test-cpp-common.h:164: syntax error before `::' token
test-cpp-common.h:165: ISO C++ forbids declaration of `free' with no type
test-cpp-common.h:165: declaration of `int free(Foo::Bar_mgr*)' not in a
namespace surrounding `::'
test-cpp-common.h:165: `int free(Foo::Bar_mgr*)' should have been declared
inside `::'
test-cpp-common.h:170: syntax error before `::' token
test-cpp-common.h:171: ISO C++ forbids declaration of `copy' with no type
test-cpp-common.h:171: declaration of `int copy(Foo::Bar_mgr*, const
Foo::Bar_mgr*)' not in a namespace surrounding `::'
test-cpp-common.h:171: `int copy(Foo::Bar_mgr*, const Foo::Bar_mgr*)' should
have been declared inside `::'
make: *** [test-server.o] Error 1
------------------------------------------
is this a bug or am i doing something wrong? (all the test cases in
orbitcpp declare arrays at the module level).
thanks,
rob
----
Robert Melby
Georgia Institute of Technology, Atlanta Georgia, 30332
uucp: ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!gt4255a
Internet: async cc gatech edu
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]