Discussion:
[omniORB] omniidl creating invalid include entry in generated header file
Lichszteld,Roman
2006-07-27 17:55:55 UTC
Permalink
I have downloaded and compiled omniORB 4.0.7 on an HP-UX 11.23 Itanium
system using the HP aC++/ANSI C B3910B A.06.10 [Mar 22 2006] compiler.

After compiling IDL files I noticed that some of generated .hh files contain
the following block:

#ifndef __header_hh_EXTERNAL_GUARD__
#define __header_hh_EXTERNAL_GUARD__
#include "header.hh"
#endif

Problem is that 'header.hh' does not exist!

For instance 'CosNotifyComm.hh': I would rather expect that section instead:

#ifndef __CosNotification_hh_EXTERNAL_GUARD__
#define __CosNotification_hh_EXTERNAL_GUARD__
#include "CosNotification.hh"
#endif

When I modified it as above everything works fine.

Similarly 'header.hh' include was generated for 'CosEventChannelAdmin.hh'
but in that case all I had to do was to remove this block as redundant.

I had no such problems while building omniORB 4.0.7 on Debian Linux
2.4.18-1-686 with gcc v2.95.4

I found similar issue reported by Brian McNamara last year but no workaround
for it so far.

Unfortunately it is not a whole story:

After I got everything up and running I tried to compile my sample IDL
(with command line options: -bcxx -Wba -Wbh='.h' -Wbs='.cxx'
-Wbd='DynSK.cxx' -Wbkeep_inc_path -C.):

#ifndef TEST_IDL
#define TEST_IDL

#include "module1.idl"
#include "module2.idl"
#include "module3.idl"

// Rest of the file...

#endif

This is header file generated by omniidl:

[...]

#ifndef ___hh_EXTERNAL_GUARD__
#define ___hh_EXTERNAL_GUARD__
#include <.h>
#endif

#ifndef __module2_hh_EXTERNAL_GUARD__
#define __module2_hh_EXTERNAL_GUARD__
#include "module2.h"
#endif

#ifndef __module3_hh_EXTERNAL_GUARD__
#define __module3_hh_EXTERNAL_GUARD__
#include "module3.h"
#endif

[...]

Again as you can see instead of '#include "module1.h"' there is an invalid
'.hh' section...

Thanks for any help,

Roman Lichszteld
Lichszteld,Roman
2006-07-27 20:26:59 UTC
Permalink
I've just made another test:

Assuming our 'test_module.idl' is in 'testDir' folder let's run omniidl
twice (in either case we want .h and .cxx files to be placed in 'testDir'):

1) From parent dir:

omniidl -bcxx -Wbh='.h' -Wbs='.cxx' -Wbd='DynSK.cxx' -Wbkeep_inc_path
-C./testDir testDir/test_module.idl

test_module.h:

#ifndef ___hh_EXTERNAL_GUARD__
#define ___hh_EXTERNAL_GUARD__
#include <testDir/.h>
#endif

2) From within 'testDir':

omniidl -bcxx -Wbh='.h' -Wbs='.cxx' -Wbd='DynSK.cxx' -Wbkeep_inc_path -C.
test_module.idl

test_module.h:

#ifndef __header_hh_EXTERNAL_GUARD__
#define __header_hh_EXTERNAL_GUARD__
#include <header.h>
#endif

What is this 'header.h' file??? Why at all is there any difference in
output?
From my understanding both runs are equivalent, aren't they?
Regards

Roman Lichszteld

Loading...